✕

MongoDB Physical Model

Schema for:

Model name: FightPandemics
Author: Nícolas de Araujo
Version: 3.1
File name: data_model.json
File path: U:\home\naraujo\Dev\FightPandemics\DataModel\v3\data_model.json
Printed On: Sun Sep 13 2020 01:22:11 GMT-0300 (Horário Padrão de Brasília)
Created with: Hackolade - Visual data modeling for NoSQL and multimodel databases
1. Model
1.1 Model FightPandemics
1.1.1 FightPandemics Entity Relationship Diagram
1.1.2 FightPandemics Properties
PropertyValue
Model nameFightPandemics
Technical nameFightPandemics
Description
AuthorNícolas de Araujo
Version3.1
DB vendorMongoDB
DB versionv4.2
Comments
1.1.3 FightPandemics DB Definitions
1.1.3.1 Field location
1.1.3.1.1 location Tree Diagram
1.1.3.1.2 location Hierarchy
Parent field: Definitions
Child field(s):
FieldTypeReqKeyDescriptionComments
coordinatesarraytrue

Array with the coordinates, specifying longitude first and latitude second, as default in the GeoJSON definition.

typestringtrue

Type of the GeoJSON Object. Please refer to the official documentation for more information.

In our case, the value will always be of the type "Point".

countrystringfalse

String holding the country's name.

citystringfalse

String holding the city's name.

neighborhoodstringfalse

String holding the neighborhood's name.

addressstringfalse

String holding the address (street, number and other details).

1.1.3.1.3 location properties
PropertyValue
Name location
Technical name
Id
Type document
Description

Location document according to the norms of a GeoJSON Object. The fields address, neighborhood, city, state and country are added to store the result of the geoprocessing.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
DBRef
Min Properties
Max Properties
Additional properties false
Comments
1.1.3.2 Field coordinates
1.1.3.2.1 coordinates Tree Diagram
1.1.3.2.2 coordinates Hierarchy
Parent field: location
Child field(s):
FieldTypeReqKeyDescriptionComments
[0]numericfalse

Location longitude

[1]numericfalse

Location latitude

1.1.3.2.3 coordinates properties
PropertyValue
Name coordinates
Technical name
Id
Type array
Description

Array with the coordinates, specifying longitude first and latitude second, as default in the GeoJSON definition.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Min items 2
Max items 2
Unique items false
Additional items true
Comments
1.1.3.3 Field [0]
1.1.3.3.1 [0] Tree Diagram
1.1.3.3.2 [0] properties
PropertyValue
Display name
Id lng
Type numeric
Subtype
Description

Location longitude

Dependencies
Primary key false
Foreign collection
Foreign field
Relationship type
Default 0
Unit degrees
Min value -180
Excl min false
Max value 180
Excl max false
Multiple of
Divisible by
Enum
Sample 35.26
Comments
1.1.3.4 Field [1]
1.1.3.4.1 [1] Tree Diagram
1.1.3.4.2 [1] properties
PropertyValue
Display name
Id lat
Type numeric
Subtype
Description

Location latitude

Dependencies
Primary key false
Foreign collection
Foreign field
Relationship type
Default 0
Unit degrees
Min value -90
Excl min false
Max value 90
Excl max false
Multiple of
Divisible by
Enum
Sample -32.83
Comments
1.1.3.5 Field type
1.1.3.5.1 type Tree Diagram
1.1.3.5.2 type properties
PropertyValue
Name type
Technical name
Id
Type string
Description

Type of the GeoJSON Object. Please refer to the official documentation for more information.

In our case, the value will always be of the type "Point".

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum Point
Sample
Comments
1.1.3.6 Field country
1.1.3.6.1 country Tree Diagram
1.1.3.6.2 country properties
PropertyValue
Name country
Technical name
Id
Type string
Description

String holding the country's name.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
1.1.3.7 Field city
1.1.3.7.1 city Tree Diagram
1.1.3.7.2 city properties
PropertyValue
Name city
Technical name
Id
Type string
Description

String holding the city's name.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
1.1.3.8 Field neighborhood
1.1.3.8.1 neighborhood Tree Diagram
1.1.3.8.2 neighborhood properties
PropertyValue
Name neighborhood
Technical name
Id
Type string
Description

String holding the neighborhood's name.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
1.1.3.9 Field address
1.1.3.9.1 address Tree Diagram
1.1.3.9.2 address properties
PropertyValue
Name address
Technical name
Id
Type string
Description

String holding the address (street, number and other details).

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
1.1.3.10 Field author
1.1.3.10.1 author Tree Diagram
1.1.3.10.2 author Hierarchy
Parent field: Definitions
Child field(s):
FieldTypeReqKeyDescriptionComments
idobjectIdtruefk

Foreign key to the user who created the post.

namestringtrue
typestringtrue
locationreferencetrue
1.1.3.10.3 author properties
PropertyValue
Name author
Technical name
Id
Type document
Description
Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
DBRef
Min Properties
Max Properties
Additional properties false
Comments
1.1.3.11 Field id
1.1.3.11.1 id Tree Diagram
1.1.3.11.2 id properties
PropertyValue
Name id
Technical name
Id
Type objectId
Description

Foreign key to the user who created the post.

Dependencies
Required true
Primary key false
Foreign collection users
Foreign field _id
Relationship type Foreign Key
Default
Sample
Comments
1.1.3.12 Field name
1.1.3.12.1 name Tree Diagram
1.1.3.12.2 name properties
PropertyValue
Name name
Technical name
Id
Type string
Description
Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
1.1.3.13 Field type
1.1.3.13.1 type Tree Diagram
1.1.3.13.2 type properties
PropertyValue
Name type
Technical name
Id
Type string
Description
Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
1.1.3.14 Field location
1.1.3.14.1 location Tree Diagram
1.1.3.14.2 location properties
PropertyValue
Name location
Technical name
$ref#model/definitions/location
Reference type model
Reference description
1.1.3.15 Field postRef
1.1.3.15.1 postRef Tree Diagram
1.1.3.15.2 postRef Hierarchy
Parent field: Definitions
Child field(s):
FieldTypeReqKeyDescriptionComments
idobjectIdtrue
objectivestringtrue

Field to indicate the post's objective. Currently only two values allowed: "offering help" and "looking for help".

titlestringtrue

The post title.

contentstringtrue

String for the post content.

authorreferencetrue
1.1.3.15.3 postRef properties
PropertyValue
Name postRef
Technical name
Id
Type document
Description

Optional post reference, allowing a post to be referenced in a message thread.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
DBRef
Min Properties
Max Properties
Additional properties false
Comments
1.1.3.16 Field id
1.1.3.16.1 id Tree Diagram
1.1.3.16.2 id properties
PropertyValue
Name id
Technical name
Id
Type objectId
Description
Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
1.1.3.17 Field objective
1.1.3.17.1 objective Tree Diagram
1.1.3.17.2 objective properties
PropertyValue
Name objective
Technical name
Id
Type string
Description

Field to indicate the post's objective. Currently only two values allowed: "offering help" and "looking for help".

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum request,offer
Sample offer
Comments
1.1.3.18 Field title
1.1.3.18.1 title Tree Diagram
1.1.3.18.2 title properties
PropertyValue
Name title
Technical name
Id
Type string
Description

The post title.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
1.1.3.19 Field content
1.1.3.19.1 content Tree Diagram
1.1.3.19.2 content properties
PropertyValue
Name content
Technical name
Id
Type string
Description

String for the post content.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
1.1.3.20 Field author
1.1.3.20.1 author Tree Diagram
1.1.3.20.2 author properties
PropertyValue
Name author
Technical name
$ref#model/definitions/author
Reference type model
Reference description
2. Databases
2.1 Database applicationDB
2.1.1 applicationDB Properties
PropertyValue
Database nameapplicationDB
Technical name
Enable sharding
Description
Comments
2.1.2 applicationDB Collections
2.1.2.1 Collection comments
2.1.2.1.1 comments Tree Diagram
2.1.2.1.2 comments Properties
PropertyValue
Collection namecomments
Technical name
Id
Description
DatabaseapplicationDB
Cappedfalse
Size
Max
Storage engineWiredTiger
Config String
Validation levelOff
Validation actionWarn
Additional propertiesfalse
Comments
2.1.2.1.3 comments Fields
FieldTypeReqKeyDescriptionComments
_idobjectIdtrue

Automatically generated object_id as primary key.

createdAtdatetrue

Timestamp with the comment's creation date

updatedAtdatetrue

Timestamp with the comment's last update date

authordocumenttrue
idobjectIdtrue

Foreign key to the user who created the post.

namestringtrue
typestringtrue
locationdocumenttrue

Location document according to the norms of a GeoJSON Object. The fields address, neighborhood, city, state and country are added to store the result of the geoprocessing.

coordinatesarraytrue

Array with the coordinates, specifying longitude first and latitude second, as default in the GeoJSON definition.

[0]numericfalse

Location longitude

[1]numericfalse

Location latitude

typestringtrue

Type of the GeoJSON Object. Please refer to the official documentation for more information.

In our case, the value will always be of the type "Point".

countrystringfalse

String holding the country's name.

citystringfalse

String holding the city's name.

neighborhoodstringfalse

String holding the neighborhood's name.

addressstringfalse

String holding the address (street, number and other details).

postIdobjectIdtrue
parentIdobjectIdfalse

If the comment is nested (in another comment), this field will hold the _id of the parent comment. Optional field, where being blank means it is a root comment.

contentstringtrue

Stirng holding the comment's content.

likesarrayfalse

Array holding the user_id of all the users who liked the comment.

[0]objectIdfalse

_id of the user who liked the comment

2.1.2.1.3.1 Field _id
2.1.2.1.3.1.1 _id Tree Diagram
2.1.2.1.3.1.2 _id properties
PropertyValue
Name _id
Technical name
Id
Type objectId
Description

Automatically generated object_id as primary key.

Dependencies
Required true
Primary key true
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.1.3.2 Field createdAt
2.1.2.1.3.2.1 createdAt Tree Diagram
2.1.2.1.3.2.2 createdAt properties
PropertyValue
Name createdAt
Technical name
Id
Type date
Description

Timestamp with the comment's creation date

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.1.3.3 Field updatedAt
2.1.2.1.3.3.1 updatedAt Tree Diagram
2.1.2.1.3.3.2 updatedAt properties
PropertyValue
Name updatedAt
Technical name
Id
Type date
Description

Timestamp with the comment's last update date

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.1.3.4 Field author
2.1.2.1.3.4.1 author Tree Diagram
2.1.2.1.3.4.2 author properties
PropertyValue
Name author
Technical name
$ref#model/definitions/author
Reference type model
Reference description
2.1.2.1.3.5 Field postId
2.1.2.1.3.5.1 postId Tree Diagram
2.1.2.1.3.5.2 postId properties
PropertyValue
Name postId
Technical name
Id
Type objectId
Description
Dependencies
Required true
Primary key false
Foreign collection posts
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.1.3.6 Field parentId
2.1.2.1.3.6.1 parentId Tree Diagram
2.1.2.1.3.6.2 parentId properties
PropertyValue
Name parentId
Technical name
Id
Type objectId
Description

If the comment is nested (in another comment), this field will hold the _id of the parent comment. Optional field, where being blank means it is a root comment.

Dependencies
Required false
Primary key false
Foreign collection comments
Foreign field _id
Relationship type Foreign Key
Default
Sample
Comments
2.1.2.1.3.7 Field content
2.1.2.1.3.7.1 content Tree Diagram
2.1.2.1.3.7.2 content properties
PropertyValue
Name content
Technical name
Id
Type string
Description

Stirng holding the comment's content.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.1.3.8 Field likes
2.1.2.1.3.8.1 likes Tree Diagram
2.1.2.1.3.8.2 likes Hierarchy
Parent field: comments
Child field(s):
FieldTypeReqKeyDescriptionComments
[0]objectIdfalsefk

_id of the user who liked the comment

2.1.2.1.3.8.3 likes properties
PropertyValue
Name likes
Technical name
Id
Type array
Description

Array holding the user_id of all the users who liked the comment.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Min items
Max items
Unique items true
Additional items true
Comments
2.1.2.1.3.9 Field [0]
2.1.2.1.3.9.1 [0] Tree Diagram
2.1.2.1.3.9.2 [0] properties
PropertyValue
Display name
Id
Type objectId
Description

_id of the user who liked the comment

Dependencies
Primary key false
Foreign collection
Foreign field
Relationship type Foreign Key
Default
Sample
Comments
2.1.2.1.4 comments Indexes
Property New Index
Name New Index
Key createdAt('ascending'), parentId('ascending'), postId('ascending')
Hashed
Unique
Drop duplicates
Sparse
Background indexing
Partial filter exp
Expire after (seconds)
Storage engine WiredTiger
Comments
2.1.2.1.5 comments JSON Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "title": "comments",
    "additionalProperties": false,
    "properties": {
        "_id": {
            "type": "string",
            "description": "Automatically generated object_id as primary key.",
            "pattern": "^[a-fA-F0-9]{24}$"
        },
        "createdAt": {
            "type": "string",
            "description": "Timestamp with the comment's creation date",
            "format": "date-time"
        },
        "updatedAt": {
            "type": "string",
            "description": "Timestamp with the comment's last update date",
            "format": "date-time"
        },
        "author": {
            "$ref": "#model/definitions/author"
        },
        "postId": {
            "type": "string",
            "pattern": "^[a-fA-F0-9]{24}$"
        },
        "parentId": {
            "type": "string",
            "description": "If the comment is nested (in another comment), this field will hold the _id of the parent comment. Optional field, where being blank means it is a root comment.",
            "pattern": "^[a-fA-F0-9]{24}$"
        },
        "content": {
            "type": "string",
            "description": "Stirng holding the comment's content."
        },
        "likes": {
            "type": "array",
            "description": "Array holding the user_id of all the users who liked the comment.",
            "additionalItems": true,
            "uniqueItems": true,
            "items": {
                "type": "string",
                "description": "_id of the user who liked the comment",
                "pattern": "^[a-fA-F0-9]{24}$"
            }
        }
    },
    "required": [
        "_id",
        "createdAt",
        "updatedAt",
        "author",
        "postId",
        "content"
    ]
}
2.1.2.1.6 comments JSON data
{
    "_id": ObjectId("507f1f77bcf86cd799439011"),
    "createdAt": ISODate("2016-04-08T15:06:21.595Z"),
    "updatedAt": ISODate("2016-04-08T15:06:21.595Z"),
    "author": {
        "id": ObjectId("507f1f77bcf86cd799439011"),
        "name": "Lorem",
        "type": "Lorem",
        "location": {
            "coordinates": [
                35.26,
                -32.83
            ],
            "type": "Point",
            "country": "Lorem",
            "city": "Lorem",
            "neighborhood": "Lorem",
            "address": "Lorem"
        }
    },
    "postId": ObjectId("507f1f77bcf86cd799439011"),
    "parentId": ObjectId("507f1f77bcf86cd799439011"),
    "content": "Lorem",
    "likes": [
        ObjectId("507f1f77bcf86cd799439011")
    ]
}
2.1.2.1.7 comments Target Script
use applicationDB;

db.createCollection( "comments",{
    "storageEngine": {
        "wiredTiger": {}
    },
    "capped": false,
    "validator": {
        "$jsonSchema": {
            "bsonType": "object",
            "title": "comments",
            "additionalProperties": false,
            "properties": {
                "_id": {
                    "bsonType": "objectId",
                    "description": "Automatically generated object_id as primary key."
                },
                "createdAt": {
                    "bsonType": "date",
                    "description": "Timestamp with the comment's creation date"
                },
                "updatedAt": {
                    "bsonType": "date",
                    "description": "Timestamp with the comment's last update date"
                },
                "author": {
                    "bsonType": "object",
                    "properties": {
                        "id": {
                            "bsonType": "objectId",
                            "description": "Foreign key to the user who created the post."
                        },
                        "name": {
                            "bsonType": "string"
                        },
                        "type": {
                            "bsonType": "string"
                        },
                        "location": {
                            "bsonType": "object",
                            "description": "Location document according to the norms of a [GeoJSON Object](https://docs.mongodb.com/manual/reference/geojson/ ).\nThe fields address, neighborhood, city, state and country are added to store the result of the geoprocessing.",
                            "properties": {
                                "coordinates": {
                                    "bsonType": "array",
                                    "description": "Array with the coordinates, specifying **longitude first** and **latitude second**, as default in the [GeoJSON](https://docs.mongodb.com/manual/reference/geojson/) definition.",
                                    "additionalItems": true,
                                    "minItems": 2,
                                    "maxItems": 2,
                                    "uniqueItems": false,
                                    "items": [
                                        {
                                            "bsonType": "number",
                                            "description": "Location longitude\n",
                                            "minimum": -180,
                                            "maximum": 180
                                        },
                                        {
                                            "bsonType": "number",
                                            "description": "Location latitude\n",
                                            "minimum": -90,
                                            "maximum": 90
                                        }
                                    ]
                                },
                                "type": {
                                    "bsonType": "string",
                                    "description": "Type of the GeoJSON Object.\nPlease refer to the [official documentation](https://docs.mongodb.com/manual/reference/geojson/ ) for more information.\n\n**In our case, the value will always be of the type \"Point\".**",
                                    "enum": [
                                        "Point"
                                    ]
                                },
                                "country": {
                                    "bsonType": "string",
                                    "description": "String holding the country's name.\n"
                                },
                                "city": {
                                    "bsonType": "string",
                                    "description": "String holding the city's name."
                                },
                                "neighborhood": {
                                    "bsonType": "string",
                                    "description": "String holding the neighborhood's name."
                                },
                                "address": {
                                    "bsonType": "string",
                                    "description": "String holding the address (street, number and other details)."
                                }
                            },
                            "additionalProperties": false,
                            "required": [
                                "coordinates",
                                "type"
                            ]
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "id",
                        "name",
                        "type"
                    ]
                },
                "postId": {
                    "bsonType": "objectId"
                },
                "parentId": {
                    "bsonType": "objectId",
                    "description": "If the comment is nested (in another comment), this field will hold the _id of the parent comment. Optional field, where being blank means it is a root comment."
                },
                "content": {
                    "bsonType": "string",
                    "description": "Stirng holding the comment's content."
                },
                "likes": {
                    "bsonType": "array",
                    "description": "Array holding the user_id of all the users who liked the comment.",
                    "additionalItems": true,
                    "uniqueItems": true,
                    "items": {
                        "bsonType": "objectId",
                        "description": "_id of the user who liked the comment"
                    }
                }
            },
            "required": [
                "_id",
                "createdAt",
                "updatedAt",
                "author",
                "postId",
                "content"
            ]
        }
    },
    "validationLevel": "off",
    "validationAction": "warn"
});
db.comments.createIndex(
{
    "createdAt": 1,
    "parentId": 1,
    "postId": 1
},
{
    "name": "New Index"
}
);
2.1.2.2 Collection feedbacks
2.1.2.2.1 feedbacks Tree Diagram
2.1.2.2.2 feedbacks Properties
PropertyValue
Collection namefeedbacks
Technical name
Id
Description

Collection to hold feedback on the application.

This may be done with the user logged or not and, depending on that, we may or may not have a reference to the user in question at this model.

DatabaseapplicationDB
Cappedfalse
Size
Max
Storage engineWiredTiger
Config String
Validation levelOff
Validation actionWarn
Additional propertiesfalse
Comments
2.1.2.2.3 feedbacks Fields
FieldTypeReqKeyDescriptionComments
_idobjectIdtrue

Automatically generated object_id as primary key.

createdAtdatetrue

Timestamp with the feedback's creation date

updatedAtdatetrue

Timestamp with the feedback's last update date

ratingnumerictrue

A rating, in a scale of 1 to 5, of the application.

Currently present as: "How well does FIghtPandemics meet your needs?".

Present in the first part of the feedback and, therefore, is required.

ipAddressipv4true

Caputred IP address in order to get user's location even if they are not logged.

Captured at the first part of the feedback and, therefore, is required.

ageinteger64false

User's age.

Currently present as: "What is your age?".

Present in the third part of the feedback and, therefore, not required.

mostValuableFeaturestringfalse

User's feedback into what is the features most valuable for him/her.

Currently present as: "Which features are the most valuable for you?".

Present in the second part of the feedback and, therefore, not required.

whatWouldChangestringfalse

User's feedback into what he/she would change about the application.

Currently present as: "If you could change one thing about FightPandemics, what would it be?".

Present in the second part of the feedback and, therefore, not required.

generalFeedbackstringfalse

User's general feedback section.

Currently present as: "Any other feedback for us?".

Present in the second part of the feedback and, therefore, not required.

covidImpactstringfalse

User's feedback into how the COVID impacted him.

Currently present as a multiple choice question.

Question: "How has COVID-19 impacted you?"

Options:

  1. I go to work/school normally
  2. I am healthy but in a stay-at-home quarentine
  3. I have mild symptoms but haven't been tested
  4. I am diagnosed with COVID-19

Present in the second part of the feedback and, therefore, not required.

userIdobjectIdfalse

Reference to the user's _id.

This will be present only if the user was logged in when completing the feedback.

locationdocumentfalse

Location document according to the norms of a GeoJSON Object. The fields address, neighborhood, city, state and country are added to store the result of the geoprocessing.

coordinatesarraytrue

Array with the coordinates, specifying longitude first and latitude second, as default in the GeoJSON definition.

[0]numericfalse

Location longitude

[1]numericfalse

Location latitude

typestringtrue

Type of the GeoJSON Object. Please refer to the official documentation for more information.

In our case, the value will always be of the type "Point".

countrystringfalse

String holding the country's name.

citystringfalse

String holding the city's name.

neighborhoodstringfalse

String holding the neighborhood's name.

addressstringfalse

String holding the address (street, number and other details).

2.1.2.2.3.1 Field createdAt
2.1.2.2.3.1.1 createdAt Tree Diagram
2.1.2.2.3.1.2 createdAt properties
PropertyValue
Name createdAt
Technical name
Id
Type date
Description

Timestamp with the feedback's creation date

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.2.3.2 Field _id
2.1.2.2.3.2.1 _id Tree Diagram
2.1.2.2.3.2.2 _id properties
PropertyValue
Name _id
Technical name
Id
Type objectId
Description

Automatically generated object_id as primary key.

Dependencies
Required true
Primary key true
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.2.3.3 Field updatedAt
2.1.2.2.3.3.1 updatedAt Tree Diagram
2.1.2.2.3.3.2 updatedAt properties
PropertyValue
Name updatedAt
Technical name
Id
Type date
Description

Timestamp with the feedback's last update date

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.2.3.4 Field rating
2.1.2.2.3.4.1 rating Tree Diagram
2.1.2.2.3.4.2 rating properties
PropertyValue
Name rating
Technical name
Id
Type numeric
Subtype
Description

A rating, in a scale of 1 to 5, of the application.

Currently present as: "How well does FIghtPandemics meet your needs?".

Present in the first part of the feedback and, therefore, is required.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Unit
Min value 1
Excl min false
Max value 5
Excl max false
Multiple of
Divisible by
Enum
Sample
Comments
2.1.2.2.3.5 Field ipAddress
2.1.2.2.3.5.1 ipAddress Tree Diagram
2.1.2.2.3.5.2 ipAddress properties
PropertyValue
Name ipAddress
Technical name
Id
Type string
Description

Caputred IP address in order to get user's location even if they are not logged.

Captured at the first part of the feedback and, therefore, is required.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format ipv4
Enum
Sample
Comments
2.1.2.2.3.6 Field age
2.1.2.2.3.6.1 age Tree Diagram
2.1.2.2.3.6.2 age properties
PropertyValue
Name age
Technical name
Id
Type numeric
Subtype integer64
Description

User's age.

Currently present as: "What is your age?".

Present in the third part of the feedback and, therefore, not required.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Unit
Min value 18
Excl min false
Max value
Excl max false
Multiple of
Divisible by
Enum
Sample
Comments
2.1.2.2.3.7 Field mostValuableFeature
2.1.2.2.3.7.1 mostValuableFeature Tree Diagram
2.1.2.2.3.7.2 mostValuableFeature properties
PropertyValue
Name mostValuableFeature
Technical name
Id
Type string
Description

User's feedback into what is the features most valuable for him/her.

Currently present as: "Which features are the most valuable for you?".

Present in the second part of the feedback and, therefore, not required.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.2.3.8 Field whatWouldChange
2.1.2.2.3.8.1 whatWouldChange Tree Diagram
2.1.2.2.3.8.2 whatWouldChange properties
PropertyValue
Name whatWouldChange
Technical name
Id
Type string
Description

User's feedback into what he/she would change about the application.

Currently present as: "If you could change one thing about FightPandemics, what would it be?".

Present in the second part of the feedback and, therefore, not required.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.2.3.9 Field generalFeedback
2.1.2.2.3.9.1 generalFeedback Tree Diagram
2.1.2.2.3.9.2 generalFeedback properties
PropertyValue
Name generalFeedback
Technical name
Id
Type string
Description

User's general feedback section.

Currently present as: "Any other feedback for us?".

Present in the second part of the feedback and, therefore, not required.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.2.3.10 Field covidImpact
2.1.2.2.3.10.1 covidImpact Tree Diagram
2.1.2.2.3.10.2 covidImpact properties
PropertyValue
Name covidImpact
Technical name
Id
Type string
Description

User's feedback into how the COVID impacted him.

Currently present as a multiple choice question.

Question: "How has COVID-19 impacted you?"

Options:

  1. I go to work/school normally
  2. I am healthy but in a stay-at-home quarentine
  3. I have mild symptoms but haven't been tested
  4. I am diagnosed with COVID-19

Present in the second part of the feedback and, therefore, not required.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.2.3.11 Field userId
2.1.2.2.3.11.1 userId Tree Diagram
2.1.2.2.3.11.2 userId properties
PropertyValue
Name userId
Technical name
Id
Type objectId
Description

Reference to the user's _id.

This will be present only if the user was logged in when completing the feedback.

Dependencies
Required false
Primary key false
Foreign collection users
Foreign field _id
Relationship type Foreign Key
Default
Sample
Comments
2.1.2.2.3.12 Field location
2.1.2.2.3.12.1 location Tree Diagram
2.1.2.2.3.12.2 location properties
PropertyValue
Name location
Technical name
$ref#model/definitions/location
Reference type model
Reference description
2.1.2.2.4 feedbacks JSON Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "title": "feedbacks",
    "description": "Collection to hold feedback on the application.\n\nThis may be done with the user logged or not and, depending on that, we may or may not have a reference to the user in question at this model.",
    "additionalProperties": false,
    "properties": {
        "createdAt": {
            "type": "string",
            "description": "Timestamp with the feedback's creation date",
            "format": "date-time"
        },
        "_id": {
            "type": "string",
            "description": "Automatically generated object_id as primary key.",
            "pattern": "^[a-fA-F0-9]{24}$"
        },
        "updatedAt": {
            "type": "string",
            "description": "Timestamp with the feedback's last update date",
            "format": "date-time"
        },
        "rating": {
            "type": "number",
            "description": "A rating, in a scale of 1 to 5, of the application.\n\nCurrently present as: \"How well does FIghtPandemics meet your needs?\".\n\nPresent in the first part of the feedback and, therefore, is required.",
            "minimum": 1,
            "maximum": 5
        },
        "ipAddress": {
            "type": "string",
            "description": "Caputred IP address in order to get user's location even if they are not logged.\n\nCaptured at the first part of the feedback and, therefore, is required.",
            "format": "ipv4"
        },
        "age": {
            "type": "integer",
            "description": "User's age.\n\nCurrently present as: \"What is your age?\".\n\nPresent in the third part of the feedback and, therefore, not required.",
            "minimum": 18
        },
        "mostValuableFeature": {
            "type": "string",
            "description": "User's feedback into what is the features most valuable for him/her.\n\nCurrently present as: \"Which features are the most valuable for you?\".\n\nPresent in the second part of the feedback and, therefore, not required."
        },
        "whatWouldChange": {
            "type": "string",
            "description": "User's feedback into what he/she would change about the application.\n\nCurrently present as: \"If you could change one thing about FightPandemics, what would it be?\".\n\nPresent in the second part of the feedback and, therefore, not required."
        },
        "generalFeedback": {
            "type": "string",
            "description": "User's general feedback section.\n\nCurrently present as: \"Any other feedback for us?\".\n\nPresent in the second part of the feedback and, therefore, not required."
        },
        "covidImpact": {
            "type": "string",
            "description": "User's feedback into how the COVID impacted him.\n\nCurrently present as a multiple choice question.\n\n**Question:** \"How has COVID-19 impacted you?\"\n\n**Options:** \n\n1. I go to work/school normally\n2. I am healthy but in a stay-at-home quarentine\n3. I have mild symptoms but haven't been tested\n4. I am diagnosed with COVID-19\n\n\nPresent in the second part of the feedback and, therefore, not required."
        },
        "userId": {
            "type": "string",
            "description": "Reference to the user's _id.\n\nThis will be present only if the user was logged in when completing the feedback.",
            "pattern": "^[a-fA-F0-9]{24}$"
        },
        "location": {
            "$ref": "#model/definitions/location"
        }
    },
    "required": [
        "createdAt",
        "_id",
        "updatedAt",
        "rating",
        "ipAddress"
    ]
}
2.1.2.2.5 feedbacks JSON data
{
    "createdAt": ISODate("2016-04-08T15:06:21.595Z"),
    "_id": ObjectId("507f1f77bcf86cd799439011"),
    "updatedAt": ISODate("2016-04-08T15:06:21.595Z"),
    "rating": 1,
    "ipAddress": "192.168.0.1",
    "age": 8528994625872795000,
    "mostValuableFeature": "Lorem",
    "whatWouldChange": "Lorem",
    "generalFeedback": "Lorem",
    "covidImpact": "Lorem",
    "userId": ObjectId("507f1f77bcf86cd799439011"),
    "location": {
        "coordinates": [
            35.26,
            -32.83
        ],
        "type": "Point",
        "country": "Lorem",
        "city": "Lorem",
        "neighborhood": "Lorem",
        "address": "Lorem"
    }
}
2.1.2.2.6 feedbacks Target Script
use applicationDB;

db.createCollection( "feedbacks",{
    "storageEngine": {
        "wiredTiger": {}
    },
    "capped": false,
    "validator": {
        "$jsonSchema": {
            "bsonType": "object",
            "title": "feedbacks",
            "description": "Collection to hold feedback on the application.\n\nThis may be done with the user logged or not and, depending on that, we may or may not have a reference to the user in question at this model.",
            "additionalProperties": false,
            "properties": {
                "_id": {
                    "bsonType": "objectId",
                    "description": "Automatically generated object_id as primary key."
                },
                "createdAt": {
                    "bsonType": "date",
                    "description": "Timestamp with the feedback's creation date"
                },
                "updatedAt": {
                    "bsonType": "date",
                    "description": "Timestamp with the feedback's last update date"
                },
                "rating": {
                    "bsonType": "number",
                    "description": "A rating, in a scale of 1 to 5, of the application.\n\nCurrently present as: \"How well does FIghtPandemics meet your needs?\".\n\nPresent in the first part of the feedback and, therefore, is required.",
                    "minimum": 1,
                    "maximum": 5
                },
                "ipAddress": {
                    "bsonType": "string",
                    "description": "Caputred IP address in order to get user's location even if they are not logged.\n\nCaptured at the first part of the feedback and, therefore, is required."
                },
                "age": {
                    "bsonType": "long",
                    "description": "User's age.\n\nCurrently present as: \"What is your age?\".\n\nPresent in the third part of the feedback and, therefore, not required.",
                    "minimum": 18
                },
                "mostValuableFeature": {
                    "bsonType": "string",
                    "description": "User's feedback into what is the features most valuable for him/her.\n\nCurrently present as: \"Which features are the most valuable for you?\".\n\nPresent in the second part of the feedback and, therefore, not required."
                },
                "whatWouldChange": {
                    "bsonType": "string",
                    "description": "User's feedback into what he/she would change about the application.\n\nCurrently present as: \"If you could change one thing about FightPandemics, what would it be?\".\n\nPresent in the second part of the feedback and, therefore, not required."
                },
                "generalFeedback": {
                    "bsonType": "string",
                    "description": "User's general feedback section.\n\nCurrently present as: \"Any other feedback for us?\".\n\nPresent in the second part of the feedback and, therefore, not required."
                },
                "covidImpact": {
                    "bsonType": "string",
                    "description": "User's feedback into how the COVID impacted him.\n\nCurrently present as a multiple choice question.\n\n**Question:** \"How has COVID-19 impacted you?\"\n\n**Options:** \n\n1. I go to work/school normally\n2. I am healthy but in a stay-at-home quarentine\n3. I have mild symptoms but haven't been tested\n4. I am diagnosed with COVID-19\n\n\nPresent in the second part of the feedback and, therefore, not required."
                },
                "userId": {
                    "bsonType": "objectId",
                    "description": "Reference to the user's _id.\n\nThis will be present only if the user was logged in when completing the feedback."
                },
                "location": {
                    "bsonType": "object",
                    "description": "Location document according to the norms of a [GeoJSON Object](https://docs.mongodb.com/manual/reference/geojson/ ).\nThe fields address, neighborhood, city, state and country are added to store the result of the geoprocessing.",
                    "properties": {
                        "coordinates": {
                            "bsonType": "array",
                            "description": "Array with the coordinates, specifying **longitude first** and **latitude second**, as default in the [GeoJSON](https://docs.mongodb.com/manual/reference/geojson/) definition.",
                            "additionalItems": true,
                            "minItems": 2,
                            "maxItems": 2,
                            "uniqueItems": false,
                            "items": [
                                {
                                    "bsonType": "number",
                                    "description": "Location longitude\n",
                                    "minimum": -180,
                                    "maximum": 180
                                },
                                {
                                    "bsonType": "number",
                                    "description": "Location latitude\n",
                                    "minimum": -90,
                                    "maximum": 90
                                }
                            ]
                        },
                        "type": {
                            "bsonType": "string",
                            "description": "Type of the GeoJSON Object.\nPlease refer to the [official documentation](https://docs.mongodb.com/manual/reference/geojson/ ) for more information.\n\n**In our case, the value will always be of the type \"Point\".**",
                            "enum": [
                                "Point"
                            ]
                        },
                        "country": {
                            "bsonType": "string",
                            "description": "String holding the country's name.\n"
                        },
                        "city": {
                            "bsonType": "string",
                            "description": "String holding the city's name."
                        },
                        "neighborhood": {
                            "bsonType": "string",
                            "description": "String holding the neighborhood's name."
                        },
                        "address": {
                            "bsonType": "string",
                            "description": "String holding the address (street, number and other details)."
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "coordinates",
                        "type"
                    ]
                }
            },
            "required": [
                "createdAt",
                "_id",
                "updatedAt",
                "rating",
                "ipAddress"
            ]
        }
    },
    "validationLevel": "off",
    "validationAction": "warn"
});
2.1.2.3 Collection messages
2.1.2.3.1 messages Tree Diagram
2.1.2.3.2 messages Properties
PropertyValue
Collection namemessages
Technical name
Id
Description

Message sent in a private conversation

DatabaseapplicationDB
Cappedfalse
Size
Max
Storage engineWiredTiger
Config String
Validation levelOff
Validation actionWarn
Additional propertiesfalse
Comments
2.1.2.3.3 messages Fields
FieldTypeReqKeyDescriptionComments
_idobjectIdtrue

ObjectId used as primary key for a message

createdAtdatetrue

Timestamp with message's creation date

updatedAtdatetrue

Timestamp with message's update date

authorIdobjectIdtrue

ObjectId of the user who sent the message

contentstringtrue

Messages content, containing html links and emojis

threadIdobjectIdtrue

Reference to the thread were the message was sent

statusstringtrue

Curerent message status, used to define if it was edited or deleted:

  • sent: message was sent and not edited or deleted.
  • edited: message was edited by the author
  • deleted: message was deleted by the author
postRefdocumentfalse

Optional post reference, allowing a post to be referenced in a message thread.

idobjectIdtrue
objectivestringtrue

Field to indicate the post's objective. Currently only two values allowed: "offering help" and "looking for help".

titlestringtrue

The post title.

contentstringtrue

String for the post content.

authordocumenttrue
idobjectIdtrue

Foreign key to the user who created the post.

namestringtrue
typestringtrue
locationdocumenttrue

Location document according to the norms of a GeoJSON Object. The fields address, neighborhood, city, state and country are added to store the result of the geoprocessing.

coordinatesarraytrue

Array with the coordinates, specifying longitude first and latitude second, as default in the GeoJSON definition.

[0]numericfalse

Location longitude

[1]numericfalse

Location latitude

typestringtrue

Type of the GeoJSON Object. Please refer to the official documentation for more information.

In our case, the value will always be of the type "Point".

countrystringfalse

String holding the country's name.

citystringfalse

String holding the city's name.

neighborhoodstringfalse

String holding the neighborhood's name.

addressstringfalse

String holding the address (street, number and other details).

2.1.2.3.3.1 Field _id
2.1.2.3.3.1.1 _id Tree Diagram
2.1.2.3.3.1.2 _id properties
PropertyValue
Name _id
Technical name
Id
Type objectId
Description

ObjectId used as primary key for a message

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.3.3.2 Field createdAt
2.1.2.3.3.2.1 createdAt Tree Diagram
2.1.2.3.3.2.2 createdAt properties
PropertyValue
Name createdAt
Technical name
Id
Type date
Description

Timestamp with message's creation date

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.3.3.3 Field updatedAt
2.1.2.3.3.3.1 updatedAt Tree Diagram
2.1.2.3.3.3.2 updatedAt properties
PropertyValue
Name updatedAt
Technical name
Id
Type date
Description

Timestamp with message's update date

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.3.3.4 Field authorId
2.1.2.3.3.4.1 authorId Tree Diagram
2.1.2.3.3.4.2 authorId properties
PropertyValue
Name authorId
Technical name
Id
Type objectId
Description

ObjectId of the user who sent the message

Dependencies
Required true
Primary key false
Foreign collection users
Foreign field _id
Relationship type Foreign Key
Default
Sample
Comments
2.1.2.3.3.5 Field content
2.1.2.3.3.5.1 content Tree Diagram
2.1.2.3.3.5.2 content properties
PropertyValue
Name content
Technical name
Id
Type string
Description

Messages content, containing html links and emojis

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.3.3.6 Field threadId
2.1.2.3.3.6.1 threadId Tree Diagram
2.1.2.3.3.6.2 threadId properties
PropertyValue
Name threadId
Technical name
Id
Type objectId
Description

Reference to the thread were the message was sent

Dependencies
Required true
Primary key false
Foreign collection thread
Foreign field _id
Relationship type Foreign Key
Default
Sample
Comments
2.1.2.3.3.7 Field status
2.1.2.3.3.7.1 status Tree Diagram
2.1.2.3.3.7.2 status properties
PropertyValue
Name status
Technical name
Id
Type string
Description

Curerent message status, used to define if it was edited or deleted:

  • sent: message was sent and not edited or deleted.
  • edited: message was edited by the author
  • deleted: message was deleted by the author
Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default sent
Min length
Max length
Pattern
Format
Enum edited,deleted,sent
Sample
Comments
2.1.2.3.3.8 Field postRef
2.1.2.3.3.8.1 postRef Tree Diagram
2.1.2.3.3.8.2 postRef properties
PropertyValue
Name postRef
Technical name
$ref#model/definitions/postRef
Reference type model
Reference description
2.1.2.3.4 messages JSON Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "title": "messages",
    "description": "Message sent in a private conversation\n",
    "additionalProperties": false,
    "properties": {
        "_id": {
            "type": "string",
            "description": "ObjectId used as primary key for a message",
            "pattern": "^[a-fA-F0-9]{24}$"
        },
        "createdAt": {
            "type": "string",
            "description": "Timestamp with message's creation date",
            "format": "date-time"
        },
        "updatedAt": {
            "type": "string",
            "description": "Timestamp with message's update date",
            "format": "date-time"
        },
        "authorId": {
            "type": "string",
            "description": "ObjectId of the user who sent the message",
            "pattern": "^[a-fA-F0-9]{24}$"
        },
        "content": {
            "type": "string",
            "description": "Messages content, containing html links and emojis "
        },
        "threadId": {
            "type": "string",
            "description": "Reference to the thread were the message was sent",
            "pattern": "^[a-fA-F0-9]{24}$"
        },
        "status": {
            "type": "string",
            "description": "Curerent message status, used to define if it was edited or deleted:\n\n* **sent**: message was sent and not edited or deleted.\n* **edited**: message was edited by the author\n* **deleted**: message was deleted by the author",
            "default": "sent",
            "enum": [
                "edited",
                "deleted",
                "sent"
            ]
        },
        "postRef": {
            "$ref": "#model/definitions/postRef"
        }
    },
    "required": [
        "_id",
        "createdAt",
        "updatedAt",
        "authorId",
        "content",
        "threadId",
        "status"
    ]
}
2.1.2.3.5 messages JSON data
{
    "_id": ObjectId("507f1f77bcf86cd799439011"),
    "createdAt": ISODate("2016-04-08T15:06:21.595Z"),
    "updatedAt": ISODate("2016-04-08T15:06:21.595Z"),
    "authorId": ObjectId("507f1f77bcf86cd799439011"),
    "content": "Lorem",
    "threadId": ObjectId("507f1f77bcf86cd799439011"),
    "status": "sent",
    "postRef": {
        "id": ObjectId("507f1f77bcf86cd799439011"),
        "objective": "offer",
        "title": "Lorem",
        "content": "Lorem",
        "author": {
            "id": ObjectId("507f1f77bcf86cd799439011"),
            "name": "Lorem",
            "type": "Lorem",
            "location": {
                "coordinates": [
                    35.26,
                    -32.83
                ],
                "type": "Point",
                "country": "Lorem",
                "city": "Lorem",
                "neighborhood": "Lorem",
                "address": "Lorem"
            }
        }
    }
}
2.1.2.3.6 messages Target Script
use applicationDB;

db.createCollection( "messages",{
    "storageEngine": {
        "wiredTiger": {}
    },
    "capped": false,
    "validator": {
        "$jsonSchema": {
            "bsonType": "object",
            "title": "messages",
            "description": "Message sent in a private conversation\n",
            "additionalProperties": false,
            "properties": {
                "_id": {
                    "bsonType": "objectId",
                    "description": "ObjectId used as primary key for a message"
                },
                "createdAt": {
                    "bsonType": "date",
                    "description": "Timestamp with message's creation date"
                },
                "updatedAt": {
                    "bsonType": "date",
                    "description": "Timestamp with message's update date"
                },
                "authorId": {
                    "bsonType": "objectId",
                    "description": "ObjectId of the user who sent the message"
                },
                "content": {
                    "bsonType": "string",
                    "description": "Messages content, containing html links and emojis "
                },
                "threadId": {
                    "bsonType": "objectId",
                    "description": "Reference to the thread were the message was sent"
                },
                "status": {
                    "bsonType": "string",
                    "description": "Curerent message status, used to define if it was edited or deleted:\n\n* **sent**: message was sent and not edited or deleted.\n* **edited**: message was edited by the author\n* **deleted**: message was deleted by the author",
                    "enum": [
                        "edited",
                        "deleted",
                        "sent"
                    ]
                },
                "postRef": {
                    "bsonType": "object",
                    "description": "Optional post reference, allowing a post to be referenced in a message thread.",
                    "properties": {
                        "id": {
                            "bsonType": "objectId"
                        },
                        "objective": {
                            "bsonType": "string",
                            "description": "Field to indicate the post's objective.\nCurrently only two values allowed: \"offering help\" and \"looking for help\".",
                            "enum": [
                                "request",
                                "offer"
                            ]
                        },
                        "title": {
                            "bsonType": "string",
                            "description": "The post title."
                        },
                        "content": {
                            "bsonType": "string",
                            "description": "String for the post content."
                        },
                        "author": {
                            "bsonType": "object",
                            "properties": {
                                "id": {
                                    "bsonType": "objectId",
                                    "description": "Foreign key to the user who created the post."
                                },
                                "name": {
                                    "bsonType": "string"
                                },
                                "type": {
                                    "bsonType": "string"
                                },
                                "location": {
                                    "bsonType": "object",
                                    "description": "Location document according to the norms of a [GeoJSON Object](https://docs.mongodb.com/manual/reference/geojson/ ).\nThe fields address, neighborhood, city, state and country are added to store the result of the geoprocessing.",
                                    "properties": {
                                        "coordinates": {
                                            "bsonType": "array",
                                            "description": "Array with the coordinates, specifying **longitude first** and **latitude second**, as default in the [GeoJSON](https://docs.mongodb.com/manual/reference/geojson/) definition.",
                                            "additionalItems": true,
                                            "minItems": 2,
                                            "maxItems": 2,
                                            "uniqueItems": false,
                                            "items": [
                                                {
                                                    "bsonType": "number",
                                                    "description": "Location longitude\n",
                                                    "minimum": -180,
                                                    "maximum": 180
                                                },
                                                {
                                                    "bsonType": "number",
                                                    "description": "Location latitude\n",
                                                    "minimum": -90,
                                                    "maximum": 90
                                                }
                                            ]
                                        },
                                        "type": {
                                            "bsonType": "string",
                                            "description": "Type of the GeoJSON Object.\nPlease refer to the [official documentation](https://docs.mongodb.com/manual/reference/geojson/ ) for more information.\n\n**In our case, the value will always be of the type \"Point\".**",
                                            "enum": [
                                                "Point"
                                            ]
                                        },
                                        "country": {
                                            "bsonType": "string",
                                            "description": "String holding the country's name.\n"
                                        },
                                        "city": {
                                            "bsonType": "string",
                                            "description": "String holding the city's name."
                                        },
                                        "neighborhood": {
                                            "bsonType": "string",
                                            "description": "String holding the neighborhood's name."
                                        },
                                        "address": {
                                            "bsonType": "string",
                                            "description": "String holding the address (street, number and other details)."
                                        }
                                    },
                                    "additionalProperties": false,
                                    "required": [
                                        "coordinates",
                                        "type"
                                    ]
                                }
                            },
                            "additionalProperties": false,
                            "required": [
                                "id",
                                "name",
                                "type"
                            ]
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "id",
                        "objective",
                        "title",
                        "content",
                        "author"
                    ]
                }
            },
            "required": [
                "_id",
                "createdAt",
                "updatedAt",
                "authorId",
                "content",
                "threadId",
                "status"
            ]
        }
    },
    "validationLevel": "off",
    "validationAction": "warn"
});
2.1.2.4 Collection notifications
2.1.2.4.1 notifications Tree Diagram
2.1.2.4.2 notifications Properties
PropertyValue
Collection namenotifications
Technical name
Id
Description
DatabaseapplicationDB
Cappedfalse
Size
Max
Storage engineWiredTiger
Config String
Validation levelOff
Validation actionWarn
Additional propertiestrue
Comments
2.1.2.4.3 notifications Fields
FieldTypeReqKeyDescriptionComments
_idobjectIdtrue

Automatically generated object_id as primary key.

createdAtdatetrue

Timestamp with the notification's creation date

updatedAtdatetrue

Timestamp with the notification's last update date

sentAtdatefalse

Timestamp of when the notification was sent

seenAtdatefalse

Timestamp with the time the notification was seen by the user

senderdocumenttrue

Document with the user the info from the user that triggered the notification

idobjectIdtrue

Foreign key to the user who created the post.

namestringtrue

Sender user's name

typestringtrue

Sender user's type

photourifalse

Sender user's photo url

receiverdocumenttrue

Document with the user the info from the user that is receivin the notification

idobjectIdtrue

Foreign key to the user who created the post.

namestringtrue

Receiver user's name

typestringtrue

Receiver user's type

photourifalse

Receiver user's photo url

oneOfchoicefalse

OneOf that decides what type of notification is this, with the determinant factor being what it is about (a post, a comment, an organization and etc)

[0] PostNotificationsubschemafalse

Notification about a post you created

postIdobjectIdtrue
typestringtrue

Type of notification

actionstringtrue

Type of action that triggered the notification

[1] CommentNotificationsubschemafalse

Notification about a comment you created

commentIdobjectIdtrue

ID of the comment where the notification was triggered

typestringtrue

Type of notification

actionstringtrue

Type of action that triggered the notification

[2] MessageNotificationsubschemafalse

Notification about private messages

threadIdobjectIdtrue

ObjectId of the Thread that has new messages

typestringtrue

Type of notification

actionstringtrue

Type of action that triggered the notification

[3] OrganizationNotificationsubschemafalse

Notification about a organization you manage

organizationIdobjectIdtrue

ObjectId of the organization the action is about

typestringtrue

Type of notification

actionstringtrue

Type of action that triggered the notification

2.1.2.4.3.1 Field _id
2.1.2.4.3.1.1 _id Tree Diagram
2.1.2.4.3.1.2 _id properties
PropertyValue
Name _id
Technical name
Id
Type objectId
Description

Automatically generated object_id as primary key.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.4.3.2 Field createdAt
2.1.2.4.3.2.1 createdAt Tree Diagram
2.1.2.4.3.2.2 createdAt properties
PropertyValue
Name createdAt
Technical name
Id
Type date
Description

Timestamp with the notification's creation date

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.4.3.3 Field updatedAt
2.1.2.4.3.3.1 updatedAt Tree Diagram
2.1.2.4.3.3.2 updatedAt properties
PropertyValue
Name updatedAt
Technical name
Id
Type date
Description

Timestamp with the notification's last update date

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.4.3.4 Field sentAt
2.1.2.4.3.4.1 sentAt Tree Diagram
2.1.2.4.3.4.2 sentAt properties
PropertyValue
Name sentAt
Technical name
Id
Type date
Description

Timestamp of when the notification was sent

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.4.3.5 Field seenAt
2.1.2.4.3.5.1 seenAt Tree Diagram
2.1.2.4.3.5.2 seenAt properties
PropertyValue
Name seenAt
Technical name
Id
Type date
Description

Timestamp with the time the notification was seen by the user

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.4.3.6 Field sender
2.1.2.4.3.6.1 sender Tree Diagram
2.1.2.4.3.6.2 sender Hierarchy
Parent field: notifications
Child field(s):
FieldTypeReqKeyDescriptionComments
idobjectIdtruefk

Foreign key to the user who created the post.

namestringtrue

Sender user's name

typestringtrue

Sender user's type

photostringfalse

Sender user's photo url

2.1.2.4.3.6.3 sender properties
PropertyValue
Name sender
Technical name
Id
Type document
Description

Document with the user the info from the user that triggered the notification

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
DBRef
Min Properties
Max Properties
Additional properties false
Comments
2.1.2.4.3.7 Field id
2.1.2.4.3.7.1 id Tree Diagram
2.1.2.4.3.7.2 id properties
PropertyValue
Name id
Technical name
Id
Type objectId
Description

Foreign key to the user who created the post.

Dependencies
Required true
Primary key false
Foreign collection users
Foreign field _id
Relationship type Foreign Key
Default
Sample
Comments
2.1.2.4.3.8 Field name
2.1.2.4.3.8.1 name Tree Diagram
2.1.2.4.3.8.2 name properties
PropertyValue
Name name
Technical name
Id
Type string
Description

Sender user's name

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.4.3.9 Field type
2.1.2.4.3.9.1 type Tree Diagram
2.1.2.4.3.9.2 type properties
PropertyValue
Name type
Technical name
Id
Type string
Description

Sender user's type

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.4.3.10 Field photo
2.1.2.4.3.10.1 photo Tree Diagram
2.1.2.4.3.10.2 photo properties
PropertyValue
Name photo
Technical name
Id
Type string
Description

Sender user's photo url

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format uri
Enum
Sample
Comments
2.1.2.4.3.11 Field receiver
2.1.2.4.3.11.1 receiver Tree Diagram
2.1.2.4.3.11.2 receiver Hierarchy
Parent field: notifications
Child field(s):
FieldTypeReqKeyDescriptionComments
idobjectIdtruefk

Foreign key to the user who created the post.

namestringtrue

Receiver user's name

typestringtrue

Receiver user's type

photostringfalse

Receiver user's photo url

2.1.2.4.3.11.3 receiver properties
PropertyValue
Name receiver
Technical name
Id
Type document
Description

Document with the user the info from the user that is receivin the notification

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
DBRef
Min Properties
Max Properties
Additional properties false
Comments
2.1.2.4.3.12 Field id
2.1.2.4.3.12.1 id Tree Diagram
2.1.2.4.3.12.2 id properties
PropertyValue
Name id
Technical name
Id
Type objectId
Description

Foreign key to the user who created the post.

Dependencies
Required true
Primary key false
Foreign collection users
Foreign field _id
Relationship type Foreign Key
Default
Sample
Comments
2.1.2.4.3.13 Field name
2.1.2.4.3.13.1 name Tree Diagram
2.1.2.4.3.13.2 name properties
PropertyValue
Name name
Technical name
Id
Type string
Description

Receiver user's name

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.4.3.14 Field type
2.1.2.4.3.14.1 type Tree Diagram
2.1.2.4.3.14.2 type properties
PropertyValue
Name type
Technical name
Id
Type string
Description

Receiver user's type

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.4.3.15 Field photo
2.1.2.4.3.15.1 photo Tree Diagram
2.1.2.4.3.15.2 photo properties
PropertyValue
Name photo
Technical name
Id
Type string
Description

Receiver user's photo url

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format uri
Enum
Sample
Comments
2.1.2.4.3.16 Field oneOf
2.1.2.4.3.16.1 oneOf Tree Diagram
2.1.2.4.3.16.2 oneOf Hierarchy
Parent field: notifications
Child field(s):
FieldTypeReqKeyDescriptionComments
[0] PostNotificationsubschemafalse

Notification about a post you created

(1)subschemafalse

Notification about a comment you created

(2)subschemafalse

Notification about private messages

[3] OrganizationNotificationsubschemafalse

Notification about a organization you manage

2.1.2.4.3.16.3 oneOf properties
PropertyValue
Choice oneOf
Description

OneOf that decides what type of notification is this, with the determinant factor being what it is about (a post, a comment, an organization and etc)

Comments
2.1.2.4.3.17 Field [0] PostNotification
2.1.2.4.3.17.1 [0] PostNotification Tree Diagram
2.1.2.4.3.17.2 [0] PostNotification Hierarchy
Parent field: oneOf
Child field(s):
FieldTypeReqKeyDescriptionComments
postIdobjectIdtruefk
typestringtrue

Type of notification

actionstringtrue

Type of action that triggered the notification

2.1.2.4.3.17.3 [0] PostNotification properties
PropertyValue
Display name PostNotification
Id
Description

Notification about a post you created

Required
Min Properties
Max Properties
Additional properties true
Comments
2.1.2.4.3.18 Field postId
2.1.2.4.3.18.1 postId Tree Diagram
2.1.2.4.3.18.2 postId properties
PropertyValue
Name postId
Technical name
Id
Type objectId
Description
Dependencies
Required true
Primary key false
Foreign collection posts
Foreign field _id
Relationship type Foreign Key
Default
Sample
Comments
2.1.2.4.3.19 Field type
2.1.2.4.3.19.1 type Tree Diagram
2.1.2.4.3.19.2 type properties
PropertyValue
Name type
Technical name
Id
Type string
Description

Type of notification

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern post
Format
Enum
Sample
Comments
2.1.2.4.3.20 Field action
2.1.2.4.3.20.1 action Tree Diagram
2.1.2.4.3.20.2 action properties
PropertyValue
Name action
Technical name
Id
Type string
Description

Type of action that triggered the notification

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum comment,like,share
Sample
Comments
2.1.2.4.3.21 Field [1] CommentNotification
2.1.2.4.3.21.1 [1] CommentNotification Tree Diagram
2.1.2.4.3.21.2 [1] CommentNotification Hierarchy
Parent field: oneOf
Child field(s):
FieldTypeReqKeyDescriptionComments
commentIdobjectIdtrue

ID of the comment where the notification was triggered

typestringtrue

Type of notification

actionstringtrue

Type of action that triggered the notification

2.1.2.4.3.21.3 [1] CommentNotification properties
PropertyValue
Display name CommentNotification
Id
Description

Notification about a comment you created

Required
Min Properties
Max Properties
Additional properties false
Comments
2.1.2.4.3.22 Field commentId
2.1.2.4.3.22.1 commentId Tree Diagram
2.1.2.4.3.22.2 commentId properties
PropertyValue
Name commentId
Technical name
Id
Type objectId
Description

ID of the comment where the notification was triggered

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.4.3.23 Field type
2.1.2.4.3.23.1 type Tree Diagram
2.1.2.4.3.23.2 type properties
PropertyValue
Name type
Technical name
Id
Type string
Description

Type of notification

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern comment
Format
Enum
Sample
Comments
2.1.2.4.3.24 Field action
2.1.2.4.3.24.1 action Tree Diagram
2.1.2.4.3.24.2 action properties
PropertyValue
Name action
Technical name
Id
Type string
Description

Type of action that triggered the notification

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum comment,like
Sample
Comments
2.1.2.4.3.25 Field [2] MessageNotification
2.1.2.4.3.25.1 [2] MessageNotification Tree Diagram
2.1.2.4.3.25.2 [2] MessageNotification Hierarchy
Parent field: oneOf
Child field(s):
FieldTypeReqKeyDescriptionComments
threadIdobjectIdtruefk

ObjectId of the Thread that has new messages

typestringtrue

Type of notification

actionstringtrue

Type of action that triggered the notification

2.1.2.4.3.25.3 [2] MessageNotification properties
PropertyValue
Display name MessageNotification
Id
Description

Notification about private messages

Required
Min Properties
Max Properties
Additional properties false
Comments
2.1.2.4.3.26 Field threadId
2.1.2.4.3.26.1 threadId Tree Diagram
2.1.2.4.3.26.2 threadId properties
PropertyValue
Name threadId
Technical name
Id
Type objectId
Description

ObjectId of the Thread that has new messages

Dependencies
Required true
Primary key false
Foreign collection thread
Foreign field _id
Relationship type Foreign Key
Default
Sample
Comments
2.1.2.4.3.27 Field type
2.1.2.4.3.27.1 type Tree Diagram
2.1.2.4.3.27.2 type properties
PropertyValue
Name type
Technical name
Id
Type string
Description

Type of notification

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern message
Format
Enum
Sample
Comments
2.1.2.4.3.28 Field action
2.1.2.4.3.28.1 action Tree Diagram
2.1.2.4.3.28.2 action properties
PropertyValue
Name action
Technical name
Id
Type string
Description

Type of action that triggered the notification

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum message
Sample
Comments
2.1.2.4.3.29 Field [3] OrganizationNotification
2.1.2.4.3.29.1 [3] OrganizationNotification Tree Diagram
2.1.2.4.3.29.2 [3] OrganizationNotification Hierarchy
Parent field: oneOf
Child field(s):
FieldTypeReqKeyDescriptionComments
organizationIdobjectIdtruefk

ObjectId of the organization the action is about

typestringtrue

Type of notification

actionstringtrue

Type of action that triggered the notification

2.1.2.4.3.29.3 [3] OrganizationNotification properties
PropertyValue
Display name OrganizationNotification
Id
Description

Notification about a organization you manage

Required
Min Properties
Max Properties
Additional properties false
Comments
2.1.2.4.3.30 Field organizationId
2.1.2.4.3.30.1 organizationId Tree Diagram
2.1.2.4.3.30.2 organizationId properties
PropertyValue
Name organizationId
Technical name
Id
Type objectId
Description

ObjectId of the organization the action is about

Dependencies
Required true
Primary key false
Foreign collection users
Foreign field _id
Relationship type Foreign Key
Default
Sample
Comments
2.1.2.4.3.31 Field type
2.1.2.4.3.31.1 type Tree Diagram
2.1.2.4.3.31.2 type properties
PropertyValue
Name type
Technical name
Id
Type string
Description

Type of notification

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern organization
Format
Enum
Sample
Comments
2.1.2.4.3.32 Field action
2.1.2.4.3.32.1 action Tree Diagram
2.1.2.4.3.32.2 action properties
PropertyValue
Name action
Technical name
Id
Type string
Description

Type of action that triggered the notification

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum join
Sample
Comments
2.1.2.4.4 notifications JSON Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "title": "notifications",
    "additionalProperties": true,
    "properties": {
        "_id": {
            "type": "string",
            "description": "Automatically generated object_id as primary key.",
            "pattern": "^[a-fA-F0-9]{24}$"
        },
        "createdAt": {
            "type": "string",
            "description": "Timestamp with the notification's creation date",
            "format": "date-time"
        },
        "updatedAt": {
            "type": "string",
            "description": "Timestamp with the notification's last update date",
            "format": "date-time"
        },
        "sentAt": {
            "type": "string",
            "description": "Timestamp of when the notification was sent ",
            "format": "date-time"
        },
        "seenAt": {
            "type": "string",
            "description": "Timestamp with the time the notification was seen by the user",
            "format": "date-time"
        },
        "sender": {
            "type": "object",
            "description": "Document with the user the info from the user that triggered the notification",
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Foreign key to the user who created the post.",
                    "pattern": "^[a-fA-F0-9]{24}$"
                },
                "name": {
                    "type": "string",
                    "description": "Sender user's name"
                },
                "type": {
                    "type": "string",
                    "description": "Sender user's type"
                },
                "photo": {
                    "type": "string",
                    "description": "Sender user's photo url",
                    "format": "uri"
                }
            },
            "additionalProperties": false,
            "required": [
                "id",
                "name",
                "type"
            ]
        },
        "receiver": {
            "type": "object",
            "description": "Document with the user the info from the user that is receivin the notification",
            "properties": {
                "id": {
                    "type": "string",
                    "description": "Foreign key to the user who created the post.",
                    "pattern": "^[a-fA-F0-9]{24}$"
                },
                "name": {
                    "type": "string",
                    "description": "Receiver user's name\n"
                },
                "type": {
                    "type": "string",
                    "description": "Receiver user's type"
                },
                "photo": {
                    "type": "string",
                    "description": "Receiver user's photo url",
                    "format": "uri"
                }
            },
            "additionalProperties": false,
            "required": [
                "id",
                "name",
                "type"
            ]
        }
    },
    "oneOf": [
        {
            "type": "object",
            "description": "Notification about a post you created",
            "properties": {
                "postId": {
                    "type": "string",
                    "pattern": "^[a-fA-F0-9]{24}$"
                },
                "type": {
                    "type": "string",
                    "description": "Type of notification",
                    "pattern": "post"
                },
                "action": {
                    "type": "string",
                    "description": "Type of action that triggered the notification",
                    "enum": [
                        "comment",
                        "like",
                        "share"
                    ]
                }
            },
            "additionalProperties": true,
            "required": [
                "postId",
                "type",
                "action"
            ]
        },
        {
            "type": "object",
            "description": "Notification about a comment you created",
            "properties": {
                "commentId": {
                    "type": "string",
                    "description": "ID of the comment where the notification was triggered",
                    "pattern": "^[a-fA-F0-9]{24}$"
                },
                "type": {
                    "type": "string",
                    "description": "Type of notification",
                    "pattern": "comment"
                },
                "action": {
                    "type": "string",
                    "description": "Type of action that triggered the notification",
                    "enum": [
                        "comment",
                        "like"
                    ]
                }
            },
            "additionalProperties": false,
            "required": [
                "commentId",
                "type",
                "action"
            ]
        },
        {
            "type": "object",
            "description": "Notification about private messages",
            "properties": {
                "threadId": {
                    "type": "string",
                    "description": "ObjectId of the Thread that has new messages",
                    "pattern": "^[a-fA-F0-9]{24}$"
                },
                "type": {
                    "type": "string",
                    "description": "Type of notification",
                    "pattern": "message"
                },
                "action": {
                    "type": "string",
                    "description": "Type of action that triggered the notification",
                    "enum": [
                        "message"
                    ]
                }
            },
            "additionalProperties": false,
            "required": [
                "threadId",
                "type",
                "action"
            ]
        },
        {
            "type": "object",
            "description": "Notification about a organization you manage",
            "properties": {
                "organizationId": {
                    "type": "string",
                    "description": "ObjectId of the organization the action is about",
                    "pattern": "^[a-fA-F0-9]{24}$"
                },
                "type": {
                    "type": "string",
                    "description": "Type of notification",
                    "pattern": "organization"
                },
                "action": {
                    "type": "string",
                    "description": "Type of action that triggered the notification",
                    "enum": [
                        "join"
                    ]
                }
            },
            "additionalProperties": false,
            "required": [
                "organizationId",
                "type",
                "action"
            ]
        }
    ],
    "required": [
        "_id",
        "createdAt",
        "updatedAt",
        "sender",
        "receiver"
    ]
}
2.1.2.4.5 notifications JSON data
{
    "_id": ObjectId("507f1f77bcf86cd799439011"),
    "createdAt": ISODate("2016-04-08T15:06:21.595Z"),
    "updatedAt": ISODate("2016-04-08T15:06:21.595Z"),
    "sentAt": ISODate("2016-04-08T15:06:21.595Z"),
    "seenAt": ISODate("2016-04-08T15:06:21.595Z"),
    "sender": {
        "id": ObjectId("507f1f77bcf86cd799439011"),
        "name": "Lorem",
        "type": "Lorem",
        "photo": "./resource.txt#frag01"
    },
    "receiver": {
        "id": ObjectId("507f1f77bcf86cd799439011"),
        "name": "Lorem",
        "type": "Lorem",
        "photo": "./resource.txt#frag01"
    },
    "postId": ObjectId("507f1f77bcf86cd799439011"),
    "type": "Lorem",
    "action": "share"
}
2.1.2.4.6 notifications Target Script
use applicationDB;

db.createCollection( "notifications",{
    "storageEngine": {
        "wiredTiger": {}
    },
    "capped": false,
    "validator": {
        "$jsonSchema": {
            "bsonType": "object",
            "title": "notifications",
            "additionalProperties": true,
            "properties": {
                "_id": {
                    "bsonType": "objectId",
                    "description": "Automatically generated object_id as primary key."
                },
                "createdAt": {
                    "bsonType": "date",
                    "description": "Timestamp with the notification's creation date"
                },
                "updatedAt": {
                    "bsonType": "date",
                    "description": "Timestamp with the notification's last update date"
                },
                "sentAt": {
                    "bsonType": "date",
                    "description": "Timestamp of when the notification was sent "
                },
                "seenAt": {
                    "bsonType": "date",
                    "description": "Timestamp with the time the notification was seen by the user"
                },
                "sender": {
                    "bsonType": "object",
                    "description": "Document with the user the info from the user that triggered the notification",
                    "properties": {
                        "id": {
                            "bsonType": "objectId",
                            "description": "Foreign key to the user who created the post."
                        },
                        "name": {
                            "bsonType": "string",
                            "description": "Sender user's name"
                        },
                        "type": {
                            "bsonType": "string",
                            "description": "Sender user's type"
                        },
                        "photo": {
                            "bsonType": "string",
                            "description": "Sender user's photo url"
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "id",
                        "name",
                        "type"
                    ]
                },
                "receiver": {
                    "bsonType": "object",
                    "description": "Document with the user the info from the user that is receivin the notification",
                    "properties": {
                        "id": {
                            "bsonType": "objectId",
                            "description": "Foreign key to the user who created the post."
                        },
                        "name": {
                            "bsonType": "string",
                            "description": "Receiver user's name\n"
                        },
                        "type": {
                            "bsonType": "string",
                            "description": "Receiver user's type"
                        },
                        "photo": {
                            "bsonType": "string",
                            "description": "Receiver user's photo url"
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "id",
                        "name",
                        "type"
                    ]
                }
            },
            "oneOf": [
                {
                    "bsonType": "object",
                    "description": "Notification about a post you created",
                    "properties": {
                        "postId": {
                            "bsonType": "objectId"
                        },
                        "type": {
                            "bsonType": "string",
                            "description": "Type of notification",
                            "pattern": "post"
                        },
                        "action": {
                            "bsonType": "string",
                            "description": "Type of action that triggered the notification",
                            "enum": [
                                "comment",
                                "like",
                                "share"
                            ]
                        }
                    },
                    "additionalProperties": true,
                    "required": [
                        "postId",
                        "type",
                        "action"
                    ]
                },
                {
                    "bsonType": "object",
                    "description": "Notification about a comment you created",
                    "properties": {
                        "commentId": {
                            "bsonType": "objectId",
                            "description": "ID of the comment where the notification was triggered"
                        },
                        "type": {
                            "bsonType": "string",
                            "description": "Type of notification",
                            "pattern": "comment"
                        },
                        "action": {
                            "bsonType": "string",
                            "description": "Type of action that triggered the notification",
                            "enum": [
                                "comment",
                                "like"
                            ]
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "commentId",
                        "type",
                        "action"
                    ]
                },
                {
                    "bsonType": "object",
                    "description": "Notification about private messages",
                    "properties": {
                        "threadId": {
                            "bsonType": "objectId",
                            "description": "ObjectId of the Thread that has new messages"
                        },
                        "type": {
                            "bsonType": "string",
                            "description": "Type of notification",
                            "pattern": "message"
                        },
                        "action": {
                            "bsonType": "string",
                            "description": "Type of action that triggered the notification",
                            "enum": [
                                "message"
                            ]
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "threadId",
                        "type",
                        "action"
                    ]
                },
                {
                    "bsonType": "object",
                    "description": "Notification about a organization you manage",
                    "properties": {
                        "organizationId": {
                            "bsonType": "objectId",
                            "description": "ObjectId of the organization the action is about"
                        },
                        "type": {
                            "bsonType": "string",
                            "description": "Type of notification",
                            "pattern": "organization"
                        },
                        "action": {
                            "bsonType": "string",
                            "description": "Type of action that triggered the notification",
                            "enum": [
                                "join"
                            ]
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "organizationId",
                        "type",
                        "action"
                    ]
                }
            ],
            "required": [
                "_id",
                "createdAt",
                "updatedAt",
                "sender",
                "receiver"
            ]
        }
    },
    "validationLevel": "off",
    "validationAction": "warn"
});
2.1.2.5 Collection posts
2.1.2.5.1 posts Tree Diagram
2.1.2.5.2 posts Properties
PropertyValue
Collection nameposts
Technical name
Id
Description

Document to represent a post, asking or offering help to be displayed on the feed

DatabaseapplicationDB
Cappedfalse
Size
Max
Storage engineWiredTiger
Config String
Validation levelOff
Validation actionWarn
Additional propertiesfalse
Comments
2.1.2.5.3 posts Fields
FieldTypeReqKeyDescriptionComments
_idobjectIdtrue
createdAtdatetrue

Timestamp with the post's creation date

updatedAtdatetrue

Timestamp with the post's last update date

expireAtdatefalse

Timestamp with the date the post will expire. If no expiration date is present, the post does not expire.

authordocumenttrue
idobjectIdtrue

Foreign key to the user who created the post.

namestringtrue
typestringtrue
locationdocumenttrue

Location document according to the norms of a GeoJSON Object. The fields address, neighborhood, city, state and country are added to store the result of the geoprocessing.

coordinatesarraytrue

Array with the coordinates, specifying longitude first and latitude second, as default in the GeoJSON definition.

[0]numericfalse

Location longitude

[1]numericfalse

Location latitude

typestringtrue

Type of the GeoJSON Object. Please refer to the official documentation for more information.

In our case, the value will always be of the type "Point".

countrystringfalse

String holding the country's name.

citystringfalse

String holding the city's name.

neighborhoodstringfalse

String holding the neighborhood's name.

addressstringfalse

String holding the address (street, number and other details).

titlestringtrue

The post title.

contentstringtrue

String for the post content.

objectivestringtrue

Field to indicate the post's objective. Currently only two values allowed: "offering help" and "looking for help".

visibilitystringtrue

Field to specify the post's visibility. It can be: worldwide, country, state and zipcode.

likesarraytrue

Array holding the user_id of all the users who liked the post.

[0]objectIdfalse

_id of the user who liked the post

typesarrayfalse

Array with the post's tags. Can be: Medical Supplies, Groceries/Food, Business, Education, Legal, Wellbeing/Mental, Entertainment, Information, Funding, R&D and Others

[0]stringfalse
languagearrayfalse
[0]stringfalse
externalLinksdocumentfalse
emailstringfalse

An email related to the post's content.

websitestringfalse

Link for a website related to the post's content.

playStorestringfalse

Link for a Play Store application related to the post's content.

appStorestringfalse

Link for a AppStore application related to the post's content.

2.1.2.5.3.1 Field _id
2.1.2.5.3.1.1 _id Tree Diagram
2.1.2.5.3.1.2 _id properties
PropertyValue
Name _id
Technical name
Id
Type objectId
Description
Dependencies
Required true
Primary key true
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.5.3.2 Field createdAt
2.1.2.5.3.2.1 createdAt Tree Diagram
2.1.2.5.3.2.2 createdAt properties
PropertyValue
Name createdAt
Technical name
Id
Type date
Description

Timestamp with the post's creation date

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.5.3.3 Field updatedAt
2.1.2.5.3.3.1 updatedAt Tree Diagram
2.1.2.5.3.3.2 updatedAt properties
PropertyValue
Name updatedAt
Technical name
Id
Type date
Description

Timestamp with the post's last update date

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.5.3.4 Field expireAt
2.1.2.5.3.4.1 expireAt Tree Diagram
2.1.2.5.3.4.2 expireAt properties
PropertyValue
Name expireAt
Technical name
Id
Type date
Description

Timestamp with the date the post will expire. If no expiration date is present, the post does not expire.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.5.3.5 Field author
2.1.2.5.3.5.1 author Tree Diagram
2.1.2.5.3.5.2 author properties
PropertyValue
Name author
Technical name
$ref#model/definitions/author
Reference type model
Reference description
2.1.2.5.3.6 Field title
2.1.2.5.3.6.1 title Tree Diagram
2.1.2.5.3.6.2 title properties
PropertyValue
Name title
Technical name
Id
Type string
Description

The post title.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.5.3.7 Field content
2.1.2.5.3.7.1 content Tree Diagram
2.1.2.5.3.7.2 content properties
PropertyValue
Name content
Technical name
Id
Type string
Description

String for the post content.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.5.3.8 Field objective
2.1.2.5.3.8.1 objective Tree Diagram
2.1.2.5.3.8.2 objective properties
PropertyValue
Name objective
Technical name
Id
Type string
Description

Field to indicate the post's objective. Currently only two values allowed: "offering help" and "looking for help".

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum request,offer
Sample offer
Comments
2.1.2.5.3.9 Field visibility
2.1.2.5.3.9.1 visibility Tree Diagram
2.1.2.5.3.9.2 visibility properties
PropertyValue
Name visibility
Technical name
Id
Type string
Description

Field to specify the post's visibility. It can be: worldwide, country, state and zipcode.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum zipcode,state,country,worldwide
Sample
Comments
2.1.2.5.3.10 Field likes
2.1.2.5.3.10.1 likes Tree Diagram
2.1.2.5.3.10.2 likes Hierarchy
Parent field: posts
Child field(s):
FieldTypeReqKeyDescriptionComments
[0]objectIdfalsefk

_id of the user who liked the post

2.1.2.5.3.10.3 likes properties
PropertyValue
Name likes
Technical name
Id
Type array
Description

Array holding the user_id of all the users who liked the post.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Min items
Max items
Unique items true
Additional items true
Comments
2.1.2.5.3.11 Field [0]
2.1.2.5.3.11.1 [0] Tree Diagram
2.1.2.5.3.11.2 [0] properties
PropertyValue
Display name
Id
Type objectId
Description

_id of the user who liked the post

Dependencies
Primary key false
Foreign collection users
Foreign field _id
Relationship type Foreign Key
Default
Sample
Comments
2.1.2.5.3.12 Field types
2.1.2.5.3.12.1 types Tree Diagram
2.1.2.5.3.12.2 types Hierarchy
Parent field: posts
Child field(s):
FieldTypeReqKeyDescriptionComments
[0]stringfalse
2.1.2.5.3.12.3 types properties
PropertyValue
Name types
Technical name
Id
Type array
Description

Array with the post's tags. Can be: Medical Supplies, Groceries/Food, Business, Education, Legal, Wellbeing/Mental, Entertainment, Information, Funding, R&D and Others

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Min items
Max items
Unique items false
Additional items true
Comments
2.1.2.5.3.13 Field [0]
2.1.2.5.3.13.1 [0] Tree Diagram
2.1.2.5.3.13.2 [0] properties
PropertyValue
Display name
Id
Type string
Description
Dependencies
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum Medical Supplies,Groceries/Food,Business,Education,Legal,Wellbeing/Mental,Entertainment,Information,Funding,R&D,Others
Sample Groceries/Food
Comments
2.1.2.5.3.14 Field language
2.1.2.5.3.14.1 language Tree Diagram
2.1.2.5.3.14.2 language Hierarchy
Parent field: posts
Child field(s):
FieldTypeReqKeyDescriptionComments
[0]stringfalse
2.1.2.5.3.14.3 language properties
PropertyValue
Name language
Technical name
Id
Type array
Description
Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Min items
Max items
Unique items false
Additional items true
Comments
2.1.2.5.3.15 Field [0]
2.1.2.5.3.15.1 [0] Tree Diagram
2.1.2.5.3.15.2 [0] properties
PropertyValue
Display name
Id
Type string
Description
Dependencies
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.5.3.16 Field externalLinks
2.1.2.5.3.16.1 externalLinks Tree Diagram
2.1.2.5.3.16.2 externalLinks Hierarchy
Parent field: posts
Child field(s):
FieldTypeReqKeyDescriptionComments
emailstringfalse

An email related to the post's content.

websitestringfalse

Link for a website related to the post's content.

playStorestringfalse

Link for a Play Store application related to the post's content.

appStorestringfalse

Link for a AppStore application related to the post's content.

2.1.2.5.3.16.3 externalLinks properties
PropertyValue
Name externalLinks
Technical name
Id
Type document
Description
Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
DBRef
Min Properties
Max Properties
Additional properties false
Comments
2.1.2.5.3.17 Field email
2.1.2.5.3.17.1 email Tree Diagram
2.1.2.5.3.17.2 email properties
PropertyValue
Name email
Technical name
Id
Type string
Description

An email related to the post's content.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.5.3.18 Field website
2.1.2.5.3.18.1 website Tree Diagram
2.1.2.5.3.18.2 website properties
PropertyValue
Name website
Technical name
Id
Type string
Description

Link for a website related to the post's content.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.5.3.19 Field playStore
2.1.2.5.3.19.1 playStore Tree Diagram
2.1.2.5.3.19.2 playStore properties
PropertyValue
Name playStore
Technical name
Id
Type string
Description

Link for a Play Store application related to the post's content.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.5.3.20 Field appStore
2.1.2.5.3.20.1 appStore Tree Diagram
2.1.2.5.3.20.2 appStore properties
PropertyValue
Name appStore
Technical name
Id
Type string
Description

Link for a AppStore application related to the post's content.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.5.4 posts JSON Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "title": "posts",
    "description": "Document to represent a post, asking or offering help to be displayed on the feed",
    "additionalProperties": false,
    "properties": {
        "_id": {
            "type": "string",
            "pattern": "^[a-fA-F0-9]{24}$"
        },
        "createdAt": {
            "type": "string",
            "description": "Timestamp with the post's creation date",
            "format": "date-time"
        },
        "updatedAt": {
            "type": "string",
            "description": "Timestamp with the post's last update date",
            "format": "date-time"
        },
        "expireAt": {
            "type": "string",
            "description": "Timestamp with the date the post will expire.\nIf no expiration date is present, the post does not expire.",
            "format": "date-time"
        },
        "author": {
            "$ref": "#model/definitions/author"
        },
        "title": {
            "type": "string",
            "description": "The post title."
        },
        "content": {
            "type": "string",
            "description": "String for the post content."
        },
        "objective": {
            "type": "string",
            "description": "Field to indicate the post's objective.\nCurrently only two values allowed: \"offering help\" and \"looking for help\".",
            "enum": [
                "request",
                "offer"
            ]
        },
        "visibility": {
            "type": "string",
            "description": "Field to specify the post's visibility. It can be: worldwide, country, state and zipcode.",
            "enum": [
                "zipcode",
                "state",
                "country",
                "worldwide"
            ]
        },
        "likes": {
            "type": "array",
            "description": "Array holding the user_id of all the users who liked the post.",
            "additionalItems": true,
            "uniqueItems": true,
            "items": {
                "type": "string",
                "description": "_id of the user who liked the post",
                "pattern": "^[a-fA-F0-9]{24}$"
            }
        },
        "types": {
            "type": "array",
            "description": "Array with the post's tags.\nCan be: Medical Supplies, Groceries/Food, Business, Education, Legal, Wellbeing/Mental, Entertainment, Information, Funding, R&D and Others",
            "additionalItems": true,
            "uniqueItems": false,
            "items": {
                "type": "string",
                "enum": [
                    "Medical Supplies",
                    "Groceries/Food",
                    "Business",
                    "Education",
                    "Legal",
                    "Wellbeing/Mental",
                    "Entertainment",
                    "Information",
                    "Funding",
                    "R&D",
                    "Others"
                ]
            }
        },
        "language": {
            "type": "array",
            "additionalItems": true,
            "uniqueItems": false,
            "items": {
                "type": "string"
            }
        },
        "externalLinks": {
            "type": "object",
            "properties": {
                "email": {
                    "type": "string",
                    "description": "An email related to the post's content."
                },
                "website": {
                    "type": "string",
                    "description": "Link for a website related to the post's content."
                },
                "playStore": {
                    "type": "string",
                    "description": "Link for a Play Store application related to the post's content."
                },
                "appStore": {
                    "type": "string",
                    "description": "Link for a AppStore application related to the post's content."
                }
            },
            "additionalProperties": false
        }
    },
    "required": [
        "_id",
        "createdAt",
        "updatedAt",
        "author",
        "title",
        "content",
        "objective",
        "visibility",
        "likes"
    ]
}
2.1.2.5.5 posts JSON data
{
    "_id": ObjectId("507f1f77bcf86cd799439011"),
    "createdAt": ISODate("2016-04-08T15:06:21.595Z"),
    "updatedAt": ISODate("2016-04-08T15:06:21.595Z"),
    "expireAt": ISODate("2016-04-08T15:06:21.595Z"),
    "author": {
        "id": ObjectId("507f1f77bcf86cd799439011"),
        "name": "Lorem",
        "type": "Lorem",
        "location": {
            "coordinates": [
                35.26,
                -32.83
            ],
            "type": "Point",
            "country": "Lorem",
            "city": "Lorem",
            "neighborhood": "Lorem",
            "address": "Lorem"
        }
    },
    "title": "Lorem",
    "content": "Lorem",
    "objective": "offer",
    "visibility": "worldwide",
    "likes": [
        ObjectId("507f1f77bcf86cd799439011")
    ],
    "types": [
        "Groceries/Food"
    ],
    "language": [
        "Lorem"
    ],
    "externalLinks": {
        "email": "Lorem",
        "website": "Lorem",
        "playStore": "Lorem",
        "appStore": "Lorem"
    }
}
2.1.2.5.6 posts Target Script
use applicationDB;

db.createCollection( "posts",{
    "storageEngine": {
        "wiredTiger": {}
    },
    "capped": false,
    "validator": {
        "$jsonSchema": {
            "bsonType": "object",
            "title": "posts",
            "description": "Document to represent a post, asking or offering help to be displayed on the feed",
            "additionalProperties": false,
            "properties": {
                "_id": {
                    "bsonType": "objectId"
                },
                "createdAt": {
                    "bsonType": "date",
                    "description": "Timestamp with the post's creation date"
                },
                "updatedAt": {
                    "bsonType": "date",
                    "description": "Timestamp with the post's last update date"
                },
                "expireAt": {
                    "bsonType": "date",
                    "description": "Timestamp with the date the post will expire.\nIf no expiration date is present, the post does not expire."
                },
                "author": {
                    "bsonType": "object",
                    "properties": {
                        "id": {
                            "bsonType": "objectId",
                            "description": "Foreign key to the user who created the post."
                        },
                        "name": {
                            "bsonType": "string"
                        },
                        "type": {
                            "bsonType": "string"
                        },
                        "location": {
                            "bsonType": "object",
                            "description": "Location document according to the norms of a [GeoJSON Object](https://docs.mongodb.com/manual/reference/geojson/ ).\nThe fields address, neighborhood, city, state and country are added to store the result of the geoprocessing.",
                            "properties": {
                                "coordinates": {
                                    "bsonType": "array",
                                    "description": "Array with the coordinates, specifying **longitude first** and **latitude second**, as default in the [GeoJSON](https://docs.mongodb.com/manual/reference/geojson/) definition.",
                                    "additionalItems": true,
                                    "minItems": 2,
                                    "maxItems": 2,
                                    "uniqueItems": false,
                                    "items": [
                                        {
                                            "bsonType": "number",
                                            "description": "Location longitude\n",
                                            "minimum": -180,
                                            "maximum": 180
                                        },
                                        {
                                            "bsonType": "number",
                                            "description": "Location latitude\n",
                                            "minimum": -90,
                                            "maximum": 90
                                        }
                                    ]
                                },
                                "type": {
                                    "bsonType": "string",
                                    "description": "Type of the GeoJSON Object.\nPlease refer to the [official documentation](https://docs.mongodb.com/manual/reference/geojson/ ) for more information.\n\n**In our case, the value will always be of the type \"Point\".**",
                                    "enum": [
                                        "Point"
                                    ]
                                },
                                "country": {
                                    "bsonType": "string",
                                    "description": "String holding the country's name.\n"
                                },
                                "city": {
                                    "bsonType": "string",
                                    "description": "String holding the city's name."
                                },
                                "neighborhood": {
                                    "bsonType": "string",
                                    "description": "String holding the neighborhood's name."
                                },
                                "address": {
                                    "bsonType": "string",
                                    "description": "String holding the address (street, number and other details)."
                                }
                            },
                            "additionalProperties": false,
                            "required": [
                                "coordinates",
                                "type"
                            ]
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "id",
                        "name",
                        "type"
                    ]
                },
                "title": {
                    "bsonType": "string",
                    "description": "The post title."
                },
                "content": {
                    "bsonType": "string",
                    "description": "String for the post content."
                },
                "objective": {
                    "bsonType": "string",
                    "description": "Field to indicate the post's objective.\nCurrently only two values allowed: \"offering help\" and \"looking for help\".",
                    "enum": [
                        "request",
                        "offer"
                    ]
                },
                "visibility": {
                    "bsonType": "string",
                    "description": "Field to specify the post's visibility. It can be: worldwide, country, state and zipcode.",
                    "enum": [
                        "zipcode",
                        "state",
                        "country",
                        "worldwide"
                    ]
                },
                "likes": {
                    "bsonType": "array",
                    "description": "Array holding the user_id of all the users who liked the post.",
                    "additionalItems": true,
                    "uniqueItems": true,
                    "items": {
                        "bsonType": "objectId",
                        "description": "_id of the user who liked the post"
                    }
                },
                "types": {
                    "bsonType": "array",
                    "description": "Array with the post's tags.\nCan be: Medical Supplies, Groceries/Food, Business, Education, Legal, Wellbeing/Mental, Entertainment, Information, Funding, R&D and Others",
                    "additionalItems": true,
                    "uniqueItems": false,
                    "items": {
                        "bsonType": "string",
                        "enum": [
                            "Medical Supplies",
                            "Groceries/Food",
                            "Business",
                            "Education",
                            "Legal",
                            "Wellbeing/Mental",
                            "Entertainment",
                            "Information",
                            "Funding",
                            "R&D",
                            "Others"
                        ]
                    }
                },
                "language": {
                    "bsonType": "array",
                    "additionalItems": true,
                    "uniqueItems": false,
                    "items": {
                        "bsonType": "string"
                    }
                },
                "externalLinks": {
                    "bsonType": "object",
                    "properties": {
                        "email": {
                            "bsonType": "string",
                            "description": "An email related to the post's content."
                        },
                        "website": {
                            "bsonType": "string",
                            "description": "Link for a website related to the post's content."
                        },
                        "playStore": {
                            "bsonType": "string",
                            "description": "Link for a Play Store application related to the post's content."
                        },
                        "appStore": {
                            "bsonType": "string",
                            "description": "Link for a AppStore application related to the post's content."
                        }
                    },
                    "additionalProperties": false
                }
            },
            "required": [
                "_id",
                "createdAt",
                "updatedAt",
                "author",
                "title",
                "content",
                "objective",
                "visibility",
                "likes"
            ]
        }
    },
    "validationLevel": "off",
    "validationAction": "warn"
});
2.1.2.6 Collection thread
2.1.2.6.1 thread Tree Diagram
2.1.2.6.2 thread Properties
PropertyValue
Collection namethread
Technical name
Id
Description

ObjectId that serves as primary key for the message thread.

DatabaseapplicationDB
Cappedfalse
Size
Max
Storage engineWiredTiger
Config String
Validation levelOff
Validation actionWarn
Additional propertiesfalse
Comments
2.1.2.6.3 thread Fields
FieldTypeReqKeyDescriptionComments
_idobjectIdtrue
createdAtdatetrue

Timestamp with the threads's creation date

updatedAtdatetrue

Timestamp with the thread's update date

statusstringtrue

Curerent thread status, used to define archives, soft deletes and other conversation status. The statuses are:

  • pending: if the user didn't accept the message request yet
  • blocked: if the one of the user's blocked the other
  • accepted: message request was accepted and users exchange messages
  • archived: user archived the message thread
participantsarraytrue

Array of user reference's, containing the participants of the message thread.

It is modelled as an array to allow expansion to group chats in the future.

[0]documenttrue
idobjectIdtrue

Foreign key to the user who created the post.

namestringtrue

User's name

typestringtrue

User's type

newMessagesbooleantrue

Flag to indicate whether there are new messages since last time the user accessed the thread.

lastAccessdatetrue

Timestamp with the last time the user accessed the message thread.

photourifalse

URL with the user photo

2.1.2.6.3.1 Field _id
2.1.2.6.3.1.1 _id Tree Diagram
2.1.2.6.3.1.2 _id properties
PropertyValue
Name _id
Technical name
Id
Type objectId
Description
Dependencies
Required true
Primary key true
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.6.3.2 Field createdAt
2.1.2.6.3.2.1 createdAt Tree Diagram
2.1.2.6.3.2.2 createdAt properties
PropertyValue
Name createdAt
Technical name
Id
Type date
Description

Timestamp with the threads's creation date

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.6.3.3 Field updatedAt
2.1.2.6.3.3.1 updatedAt Tree Diagram
2.1.2.6.3.3.2 updatedAt properties
PropertyValue
Name updatedAt
Technical name
Id
Type date
Description

Timestamp with the thread's update date

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.6.3.4 Field status
2.1.2.6.3.4.1 status Tree Diagram
2.1.2.6.3.4.2 status properties
PropertyValue
Name status
Technical name
Id
Type string
Description

Curerent thread status, used to define archives, soft deletes and other conversation status. The statuses are:

  • pending: if the user didn't accept the message request yet
  • blocked: if the one of the user's blocked the other
  • accepted: message request was accepted and users exchange messages
  • archived: user archived the message thread
Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default pending
Min length
Max length
Pattern
Format
Enum blocked,accepted,pending,archived
Sample
Comments
2.1.2.6.3.5 Field participants
2.1.2.6.3.5.1 participants Tree Diagram
2.1.2.6.3.5.2 participants Hierarchy
Parent field: thread
Child field(s):
FieldTypeReqKeyDescriptionComments
[0]documenttrue
2.1.2.6.3.5.3 participants properties
PropertyValue
Name participants
Technical name
Id
Type array
Description

Array of user reference's, containing the participants of the message thread.

It is modelled as an array to allow expansion to group chats in the future.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Min items 2
Max items
Unique items false
Additional items true
Comments
2.1.2.6.3.6 Field [0]
2.1.2.6.3.6.1 [0] Tree Diagram
2.1.2.6.3.6.2 [0] Hierarchy
Parent field: participants
Child field(s):
FieldTypeReqKeyDescriptionComments
idobjectIdtruefk

Foreign key to the user who created the post.

namestringtrue

User's name

typestringtrue

User's type

newMessagesbooleantrue

Flag to indicate whether there are new messages since last time the user accessed the thread.

lastAccessdatetrue

Timestamp with the last time the user accessed the message thread.

photostringfalse

URL with the user photo

2.1.2.6.3.6.3 [0] properties
PropertyValue
Id
Type document
Description
Dependencies
Primary key false
Foreign collection
Foreign field
Relationship type
DBRef
Min Properties
Max Properties
Additional properties false
Comments
2.1.2.6.3.7 Field id
2.1.2.6.3.7.1 id Tree Diagram
2.1.2.6.3.7.2 id properties
PropertyValue
Name id
Technical name
Id
Type objectId
Description

Foreign key to the user who created the post.

Dependencies
Required true
Primary key false
Foreign collection users
Foreign field _id
Relationship type Foreign Key
Default
Sample
Comments
2.1.2.6.3.8 Field name
2.1.2.6.3.8.1 name Tree Diagram
2.1.2.6.3.8.2 name properties
PropertyValue
Name name
Technical name
Id
Type string
Description

User's name

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.6.3.9 Field type
2.1.2.6.3.9.1 type Tree Diagram
2.1.2.6.3.9.2 type properties
PropertyValue
Name type
Technical name
Id
Type string
Description

User's type

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.6.3.10 Field newMessages
2.1.2.6.3.10.1 newMessages Tree Diagram
2.1.2.6.3.10.2 newMessages properties
PropertyValue
Name newMessages
Technical name
Id
Type boolean
Description

Flag to indicate whether there are new messages since last time the user accessed the thread.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default false
Sample
Comments
2.1.2.6.3.11 Field lastAccess
2.1.2.6.3.11.1 lastAccess Tree Diagram
2.1.2.6.3.11.2 lastAccess properties
PropertyValue
Name lastAccess
Technical name
Id
Type date
Description

Timestamp with the last time the user accessed the message thread.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.6.3.12 Field photo
2.1.2.6.3.12.1 photo Tree Diagram
2.1.2.6.3.12.2 photo properties
PropertyValue
Name photo
Technical name
Id
Type string
Description

URL with the user photo

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format uri
Enum
Sample
Comments
2.1.2.6.4 thread JSON Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "title": "thread",
    "description": "ObjectId that serves as primary key for the message thread.",
    "additionalProperties": false,
    "properties": {
        "_id": {
            "type": "string",
            "pattern": "^[a-fA-F0-9]{24}$"
        },
        "createdAt": {
            "type": "string",
            "description": "Timestamp with the threads's creation date",
            "format": "date-time"
        },
        "updatedAt": {
            "type": "string",
            "description": "Timestamp with the thread's update date",
            "format": "date-time"
        },
        "status": {
            "type": "string",
            "description": "Curerent thread status, used to define archives, soft deletes and other conversation status. The statuses are:\n\n* **pending**: if the user didn't accept the message request yet\n* **blocked**: if the one of the user's blocked the other\n* **accepted**: message request was accepted and users exchange messages\n* **archived**: user archived the message thread\n",
            "default": "pending",
            "enum": [
                "blocked",
                "accepted",
                "pending",
                "archived"
            ]
        },
        "participants": {
            "type": "array",
            "description": "Array of user reference's, containing the participants of the message thread.\n\nIt is modelled as an array to allow expansion to group chats in the future.",
            "additionalItems": true,
            "minItems": 2,
            "uniqueItems": false,
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "Foreign key to the user who created the post.",
                        "pattern": "^[a-fA-F0-9]{24}$"
                    },
                    "name": {
                        "type": "string",
                        "description": "User's name"
                    },
                    "type": {
                        "type": "string",
                        "description": "User's type"
                    },
                    "newMessages": {
                        "type": "boolean",
                        "description": "Flag to indicate whether there are new messages since last time the user accessed the thread.",
                        "default": false
                    },
                    "lastAccess": {
                        "type": "string",
                        "description": "Timestamp with the last time the user accessed the message thread.",
                        "format": "date-time"
                    },
                    "photo": {
                        "type": "string",
                        "description": "URL with the user photo",
                        "format": "uri"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id",
                    "name",
                    "type",
                    "newMessages",
                    "lastAccess"
                ]
            }
        }
    },
    "required": [
        "_id",
        "createdAt",
        "updatedAt",
        "status",
        "participants"
    ]
}
2.1.2.6.5 thread JSON data
{
    "_id": ObjectId("507f1f77bcf86cd799439011"),
    "createdAt": ISODate("2016-04-08T15:06:21.595Z"),
    "updatedAt": ISODate("2016-04-08T15:06:21.595Z"),
    "status": "pending",
    "participants": [
        {
            "id": ObjectId("507f1f77bcf86cd799439011"),
            "name": "Lorem",
            "type": "Lorem",
            "newMessages": false,
            "lastAccess": ISODate("2016-04-08T15:06:21.595Z"),
            "photo": "./resource.txt#frag01"
        }
    ]
}
2.1.2.6.6 thread Target Script
use applicationDB;

db.createCollection( "thread",{
    "storageEngine": {
        "wiredTiger": {}
    },
    "capped": false,
    "validator": {
        "$jsonSchema": {
            "bsonType": "object",
            "title": "thread",
            "description": "ObjectId that serves as primary key for the message thread.",
            "additionalProperties": false,
            "properties": {
                "_id": {
                    "bsonType": "objectId"
                },
                "createdAt": {
                    "bsonType": "date",
                    "description": "Timestamp with the threads's creation date"
                },
                "updatedAt": {
                    "bsonType": "date",
                    "description": "Timestamp with the thread's update date"
                },
                "status": {
                    "bsonType": "string",
                    "description": "Curerent thread status, used to define archives, soft deletes and other conversation status. The statuses are:\n\n* **pending**: if the user didn't accept the message request yet\n* **blocked**: if the one of the user's blocked the other\n* **accepted**: message request was accepted and users exchange messages\n* **archived**: user archived the message thread\n",
                    "enum": [
                        "blocked",
                        "accepted",
                        "pending",
                        "archived"
                    ]
                },
                "participants": {
                    "bsonType": "array",
                    "description": "Array of user reference's, containing the participants of the message thread.\n\nIt is modelled as an array to allow expansion to group chats in the future.",
                    "additionalItems": true,
                    "minItems": 2,
                    "uniqueItems": false,
                    "items": {
                        "bsonType": "object",
                        "properties": {
                            "id": {
                                "bsonType": "objectId",
                                "description": "Foreign key to the user who created the post."
                            },
                            "name": {
                                "bsonType": "string",
                                "description": "User's name"
                            },
                            "type": {
                                "bsonType": "string",
                                "description": "User's type"
                            },
                            "newMessages": {
                                "bsonType": "bool",
                                "description": "Flag to indicate whether there are new messages since last time the user accessed the thread."
                            },
                            "lastAccess": {
                                "bsonType": "date",
                                "description": "Timestamp with the last time the user accessed the message thread."
                            },
                            "photo": {
                                "bsonType": "string",
                                "description": "URL with the user photo"
                            }
                        },
                        "additionalProperties": false,
                        "required": [
                            "id",
                            "name",
                            "type",
                            "newMessages",
                            "lastAccess"
                        ]
                    }
                }
            },
            "required": [
                "_id",
                "createdAt",
                "updatedAt",
                "status",
                "participants"
            ]
        }
    },
    "validationLevel": "off",
    "validationAction": "warn"
});
2.1.2.7 Collection users
2.1.2.7.1 users Tree Diagram
2.1.2.7.2 users Properties
PropertyValue
Collection nameusers
Technical name
Id
Description

Collection that holds all the data on system's users.

The users can be of two types: (1) Individual, representing a private user account; and (2) Organization, representing an organization of various types.

The field 'type' is used to differentiate between the two subschemas, with 'individual' representing private user accounts and "Community", "Government", "Health care provider", "Non-profit", "Other", "R&D", "Startup", "Traditional Company" and "University".

DatabaseapplicationDB
Cappedfalse
Size
Max
Storage engineWiredTiger
Config String
Validation levelOff
Validation actionWarn
Additional propertiestrue
Comments
2.1.2.7.3 users Fields
FieldTypeReqKeyDescriptionComments
_idobjectIdtrue

Automatically generated _it as primary key.

createdAtdatetrue

Timestamp with the user's creation date

Thu Apr 16 2020 04:59:24 GMT-0300 (Horário Padrão de Brasília): changed the name to registeredAt

updatedAtdatetrue

Timestamp indicating last update on the database.

authIdstringtrue

String holding the authentication service id (Auth0).

This field is a foreign key to the user in the Auth0 database, connecting through the user_id field.

locationdocumentfalse

Location document according to the norms of a GeoJSON Object. The fields address, neighborhood, city, state and country are added to store the result of the geoprocessing.

coordinatesarraytrue

Array with the coordinates, specifying longitude first and latitude second, as default in the GeoJSON definition.

[0]numericfalse

Location longitude

[1]numericfalse

Location latitude

typestringtrue

Type of the GeoJSON Object. Please refer to the official documentation for more information.

In our case, the value will always be of the type "Point".

countrystringfalse

String holding the country's name.

citystringfalse

String holding the city's name.

neighborhoodstringfalse

String holding the neighborhood's name.

addressstringfalse

String holding the address (street, number and other details).

aboutstringfalse

Small self-introduction, limited to 100 char

photourifalse

URI with the location of the profile's photo.

oneOfchoicefalse
[0] subschemasubschemafalse

Subschema representing a individual account.

typestringtrue
firstNamestringtrue

The first name of the user

lastNamestringfalse

The last name of the user. Optional field.

needsdocumenttrue

User's need in the app, representing what kind of help he/she needs

medicalHelpbooleantrue

Flag to indicate wheter the user needs medical help. Marking this indicates he shows symptoms of COVID-19.

otherHelpbooleantrue

Flag to indicate wheter the user needs non-medical help, such as getting groceries, medice and etc..

objectivesdocumentfalse

Document with what are the objectives of the user through the application, such as donating, volunteering or sharing information.

volunteerbooleantrue

Flag to indicate wheter the user wants to volunteer for iniciatives through the app.

donatebooleantrue

Flag to indicate wheter the user wants to donate for iniciatives through the app.

shareInformationbooleantrue

Flag to indicate wheter the user wants to share information through the app.

urlsdocumentfalse

Document holding the user urls to external websites and social networks

facebookurifalse

URL to user's Facebook page.

linkedinurifalse

URL to user's Linkedin page.

twitterurifalse

URL to user's Twitter page.

githuburifalse

URL to user's Github page.

websiteurifalse

URL to user's personal website.

[1] subschemasubschemafalse

Subschema representing an organization (colective) account.

typestringtrue

The type of the organization. Can be: Community, Government, Health care provider, Non-profit, Other, R&D, Startup, Traditional Company and University. All names are store in lowercase only.

industrystringtrue

Industry from which the organization participates. Plan is for this values to be scraped from linkedin industries.

ownerIdobjectIdtrue

_id of the user who owns the organization.

namestringtrue

Organization's name.

needsdocumenttrue

Document with what are the objectives of the organization through the application, such as finding volunteers, staff, investors and donors.

volunteersbooleantrue

Flag to indicate wheter the organization is seeking volunteers through the app.

donationsbooleantrue

Flag to indicate wheter the organization is seeking donations through the app.

staffbooleantrue

Flag to indicate wheter the organization is seeking staff through the app.

otherbooleantrue

Flag to indicate wheter the organization is seeking other needs through the app.

globalbooleanfalse

Flag to indicate wheter this organization is global.

urlsdocumentfalse

Document holding external urls and refs to the organization such as social media profiles.

linkedinurifalse

URL to organization's Linkedin page.

twitterurifalse

URL to organization's Twitter page.

websiteurifalse

URL to organization's website.

playstoreurifalse

URL to organization's page at Google Play Store.

appstoreurifalse

URL to organization's page at Apple App Store

languagestringfalse

Field to inidicate the language used by the organization.

anyOfchoicefalse
[0] subschemasubschemafalse

Case where the user comes from social networks with a registration that uses email. In this case, the email field is required. This case covers the great majority of currently supported social network authentications.

emailemailtrue

User's email validated by a regex pattern.

[1] subschemasubschemafalse

Case where the user comes from social networks with a registration that allows the use of only the phone. In this case, the phone field is required, and the email isn't.

An example of ocial network that falls into this case is Twitter.

phonestringtrue
2.1.2.7.3.1 Field createdAt
2.1.2.7.3.1.1 createdAt Tree Diagram
2.1.2.7.3.1.2 createdAt properties
PropertyValue
Name createdAt
Technical name
Id
Type date
Description

Timestamp with the user's creation date

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments

Thu Apr 16 2020 04:59:24 GMT-0300 (Horário Padrão de Brasília): changed the name to registeredAt

2.1.2.7.3.2 Field _id
2.1.2.7.3.2.1 _id Tree Diagram
2.1.2.7.3.2.2 _id properties
PropertyValue
Name _id
Technical name
Id
Type objectId
Description

Automatically generated _it as primary key.

Dependencies
Required true
Primary key true
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.7.3.3 Field updatedAt
2.1.2.7.3.3.1 updatedAt Tree Diagram
2.1.2.7.3.3.2 updatedAt properties
PropertyValue
Name updatedAt
Technical name
Id
Type date
Description

Timestamp indicating last update on the database.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Sample
Comments
2.1.2.7.3.4 Field authId
2.1.2.7.3.4.1 authId Tree Diagram
2.1.2.7.3.4.2 authId properties
PropertyValue
Name authId
Technical name
Id
Type string
Description

String holding the authentication service id (Auth0).

This field is a foreign key to the user in the Auth0 database, connecting through the user_id field.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.7.3.5 Field location
2.1.2.7.3.5.1 location Tree Diagram
2.1.2.7.3.5.2 location properties
PropertyValue
Name location
Technical name
$ref#model/definitions/location
Reference type model
Reference description
2.1.2.7.3.6 Field about
2.1.2.7.3.6.1 about Tree Diagram
2.1.2.7.3.6.2 about properties
PropertyValue
Name about
Technical name
Id
Type string
Description

Small self-introduction, limited to 100 char

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.7.3.7 Field photo
2.1.2.7.3.7.1 photo Tree Diagram
2.1.2.7.3.7.2 photo properties
PropertyValue
Name photo
Technical name
Id
Type string
Description

URI with the location of the profile's photo.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format uri
Enum
Sample
Comments
2.1.2.7.3.8 Field oneOf
2.1.2.7.3.8.1 oneOf Tree Diagram
2.1.2.7.3.8.2 oneOf Hierarchy
Parent field: users
Child field(s):
FieldTypeReqKeyDescriptionComments
subschemasubschemafalse

Subschema representing a individual account.

subschemasubschemafalse

Subschema representing an organization (colective) account.

2.1.2.7.3.8.3 oneOf properties
PropertyValue
Choice oneOf
Description
Comments
2.1.2.7.3.9 Field [0] subschema
2.1.2.7.3.9.1 [0] subschema Tree Diagram
2.1.2.7.3.9.2 [0] subschema Hierarchy
Parent field: oneOf
Child field(s):
FieldTypeReqKeyDescriptionComments
typestringtrue
firstNamestringtrue

The first name of the user

lastNamestringfalse

The last name of the user. Optional field.

needsdocumenttrue

User's need in the app, representing what kind of help he/she needs

objectivesdocumentfalse

Document with what are the objectives of the user through the application, such as donating, volunteering or sharing information.

urlsdocumentfalse

Document holding the user urls to external websites and social networks

2.1.2.7.3.9.3 [0] subschema properties
PropertyValue
Display name subschema
Id individual
Description

Subschema representing a individual account.

Required
Min Properties
Max Properties
Additional properties true
Comments
2.1.2.7.3.10 Field type
2.1.2.7.3.10.1 type Tree Diagram
2.1.2.7.3.10.2 type properties
PropertyValue
Name type
Technical name
Id
Type string
Description
Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum individual
Sample
Comments
2.1.2.7.3.11 Field firstName
2.1.2.7.3.11.1 firstName Tree Diagram
2.1.2.7.3.11.2 firstName properties
PropertyValue
Name firstName
Technical name
Id
Type string
Description

The first name of the user

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.7.3.12 Field lastName
2.1.2.7.3.12.1 lastName Tree Diagram
2.1.2.7.3.12.2 lastName properties
PropertyValue
Name lastName
Technical name
Id
Type string
Description

The last name of the user. Optional field.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.7.3.13 Field needs
2.1.2.7.3.13.1 needs Tree Diagram
2.1.2.7.3.13.2 needs Hierarchy
Parent field: [0] subschema
Child field(s):
FieldTypeReqKeyDescriptionComments
medicalHelpbooleantrue

Flag to indicate wheter the user needs medical help. Marking this indicates he shows symptoms of COVID-19.

otherHelpbooleantrue

Flag to indicate wheter the user needs non-medical help, such as getting groceries, medice and etc..

2.1.2.7.3.13.3 needs properties
PropertyValue
Name needs
Technical name
Id
Type document
Description

User's need in the app, representing what kind of help he/she needs

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
DBRef
Min Properties
Max Properties
Additional properties false
Comments
2.1.2.7.3.14 Field medicalHelp
2.1.2.7.3.14.1 medicalHelp Tree Diagram
2.1.2.7.3.14.2 medicalHelp properties
PropertyValue
Name medicalHelp
Technical name
Id
Type boolean
Description

Flag to indicate wheter the user needs medical help. Marking this indicates he shows symptoms of COVID-19.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default false
Sample false
Comments
2.1.2.7.3.15 Field otherHelp
2.1.2.7.3.15.1 otherHelp Tree Diagram
2.1.2.7.3.15.2 otherHelp properties
PropertyValue
Name otherHelp
Technical name
Id
Type boolean
Description

Flag to indicate wheter the user needs non-medical help, such as getting groceries, medice and etc..

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default false
Sample false
Comments
2.1.2.7.3.16 Field objectives
2.1.2.7.3.16.1 objectives Tree Diagram
2.1.2.7.3.16.2 objectives Hierarchy
Parent field: [0] subschema
Child field(s):
FieldTypeReqKeyDescriptionComments
volunteerbooleantrue

Flag to indicate wheter the user wants to volunteer for iniciatives through the app.

donatebooleantrue

Flag to indicate wheter the user wants to donate for iniciatives through the app.

shareInformationbooleantrue

Flag to indicate wheter the user wants to share information through the app.

2.1.2.7.3.16.3 objectives properties
PropertyValue
Name objectives
Technical name
Id
Type document
Description

Document with what are the objectives of the user through the application, such as donating, volunteering or sharing information.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
DBRef
Min Properties
Max Properties
Additional properties false
Comments
2.1.2.7.3.17 Field volunteer
2.1.2.7.3.17.1 volunteer Tree Diagram
2.1.2.7.3.17.2 volunteer properties
PropertyValue
Name volunteer
Technical name
Id
Type boolean
Description

Flag to indicate wheter the user wants to volunteer for iniciatives through the app.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default false
Sample false
Comments
2.1.2.7.3.18 Field donate
2.1.2.7.3.18.1 donate Tree Diagram
2.1.2.7.3.18.2 donate properties
PropertyValue
Name donate
Technical name
Id
Type boolean
Description

Flag to indicate wheter the user wants to donate for iniciatives through the app.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default false
Sample false
Comments
2.1.2.7.3.19 Field shareInformation
2.1.2.7.3.19.1 shareInformation Tree Diagram
2.1.2.7.3.19.2 shareInformation properties
PropertyValue
Name shareInformation
Technical name
Id
Type boolean
Description

Flag to indicate wheter the user wants to share information through the app.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default true
Sample true
Comments
2.1.2.7.3.20 Field urls
2.1.2.7.3.20.1 urls Tree Diagram
2.1.2.7.3.20.2 urls Hierarchy
Parent field: [0] subschema
Child field(s):
FieldTypeReqKeyDescriptionComments
facebookstringfalse

URL to user's Facebook page.

linkedinstringfalse

URL to user's Linkedin page.

twitterstringfalse

URL to user's Twitter page.

githubstringfalse

URL to user's Github page.

websitestringfalse

URL to user's personal website.

2.1.2.7.3.20.3 urls properties
PropertyValue
Name urls
Technical name
Id
Type document
Description

Document holding the user urls to external websites and social networks

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
DBRef
Min Properties
Max Properties
Additional properties false
Comments
2.1.2.7.3.21 Field facebook
2.1.2.7.3.21.1 facebook Tree Diagram
2.1.2.7.3.21.2 facebook properties
PropertyValue
Name facebook
Technical name
Id
Type string
Description

URL to user's Facebook page.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format uri
Enum
Sample http://facebook.com/myProfile
Comments
2.1.2.7.3.22 Field linkedin
2.1.2.7.3.22.1 linkedin Tree Diagram
2.1.2.7.3.22.2 linkedin properties
PropertyValue
Name linkedin
Technical name
Id
Type string
Description

URL to user's Linkedin page.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format uri
Enum
Sample http://linkedin.com/in/myProfile
Comments
2.1.2.7.3.23 Field twitter
2.1.2.7.3.23.1 twitter Tree Diagram
2.1.2.7.3.23.2 twitter properties
PropertyValue
Name twitter
Technical name
Id
Type string
Description

URL to user's Twitter page.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format uri
Enum
Sample http://twitter.com/myProfile
Comments
2.1.2.7.3.24 Field github
2.1.2.7.3.24.1 github Tree Diagram
2.1.2.7.3.24.2 github properties
PropertyValue
Name github
Technical name
Id
Type string
Description

URL to user's Github page.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format uri
Enum
Sample http://github.com/myProfile
Comments
2.1.2.7.3.25 Field website
2.1.2.7.3.25.1 website Tree Diagram
2.1.2.7.3.25.2 website properties
PropertyValue
Name website
Technical name
Id
Type string
Description

URL to user's personal website.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format uri
Enum
Sample http://mypersonalwebsite.com
Comments
2.1.2.7.3.26 Field [1] subschema
2.1.2.7.3.26.1 [1] subschema Tree Diagram
2.1.2.7.3.26.2 [1] subschema Hierarchy
Parent field: oneOf
Child field(s):
FieldTypeReqKeyDescriptionComments
typestringtrue

The type of the organization. Can be: Community, Government, Health care provider, Non-profit, Other, R&D, Startup, Traditional Company and University. All names are store in lowercase only.

industrystringtrue

Industry from which the organization participates. Plan is for this values to be scraped from linkedin industries.

ownerIdobjectIdtruefk

_id of the user who owns the organization.

namestringtrue

Organization's name.

needsdocumenttrue

Document with what are the objectives of the organization through the application, such as finding volunteers, staff, investors and donors.

globalbooleanfalse

Flag to indicate wheter this organization is global.

urlsdocumentfalse

Document holding external urls and refs to the organization such as social media profiles.

languagestringfalse

Field to inidicate the language used by the organization.

2.1.2.7.3.26.3 [1] subschema properties
PropertyValue
Display name subschema
Id organization
Description

Subschema representing an organization (colective) account.

Required
Min Properties
Max Properties
Additional properties false
Comments
2.1.2.7.3.27 Field type
2.1.2.7.3.27.1 type Tree Diagram
2.1.2.7.3.27.2 type properties
PropertyValue
Name type
Technical name
Id
Type string
Description

The type of the organization. Can be: Community, Government, Health care provider, Non-profit, Other, R&D, Startup, Traditional Company and University. All names are store in lowercase only.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum startup,traditional company,community,government,r&d,non-profit,university,health care provider,other
Sample
Comments
2.1.2.7.3.28 Field industry
2.1.2.7.3.28.1 industry Tree Diagram
2.1.2.7.3.28.2 industry properties
PropertyValue
Name industry
Technical name
Id
Type string
Description

Industry from which the organization participates. Plan is for this values to be scraped from linkedin industries.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.7.3.29 Field ownerId
2.1.2.7.3.29.1 ownerId Tree Diagram
2.1.2.7.3.29.2 ownerId properties
PropertyValue
Name ownerId
Technical name
Id
Type objectId
Description

_id of the user who owns the organization.

Dependencies
Required true
Primary key false
Foreign collection users
Foreign field _id
Relationship type Foreign Key
Default
Sample
Comments
2.1.2.7.3.30 Field name
2.1.2.7.3.30.1 name Tree Diagram
2.1.2.7.3.30.2 name properties
PropertyValue
Name name
Technical name
Id
Type string
Description

Organization's name.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.7.3.31 Field needs
2.1.2.7.3.31.1 needs Tree Diagram
2.1.2.7.3.31.2 needs Hierarchy
Parent field: [1] subschema
Child field(s):
FieldTypeReqKeyDescriptionComments
volunteersbooleantrue

Flag to indicate wheter the organization is seeking volunteers through the app.

donationsbooleantrue

Flag to indicate wheter the organization is seeking donations through the app.

staffbooleantrue

Flag to indicate wheter the organization is seeking staff through the app.

otherbooleantrue

Flag to indicate wheter the organization is seeking other needs through the app.

2.1.2.7.3.31.3 needs properties
PropertyValue
Name needs
Technical name
Id
Type document
Description

Document with what are the objectives of the organization through the application, such as finding volunteers, staff, investors and donors.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
DBRef
Min Properties
Max Properties
Additional properties false
Comments
2.1.2.7.3.32 Field volunteers
2.1.2.7.3.32.1 volunteers Tree Diagram
2.1.2.7.3.32.2 volunteers properties
PropertyValue
Name volunteers
Technical name
Id
Type boolean
Description

Flag to indicate wheter the organization is seeking volunteers through the app.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default false
Sample true
Comments
2.1.2.7.3.33 Field donations
2.1.2.7.3.33.1 donations Tree Diagram
2.1.2.7.3.33.2 donations properties
PropertyValue
Name donations
Technical name
Id
Type boolean
Description

Flag to indicate wheter the organization is seeking donations through the app.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default false
Sample false
Comments
2.1.2.7.3.34 Field staff
2.1.2.7.3.34.1 staff Tree Diagram
2.1.2.7.3.34.2 staff properties
PropertyValue
Name staff
Technical name
Id
Type boolean
Description

Flag to indicate wheter the organization is seeking staff through the app.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default false
Sample false
Comments
2.1.2.7.3.35 Field other
2.1.2.7.3.35.1 other Tree Diagram
2.1.2.7.3.35.2 other properties
PropertyValue
Name other
Technical name
Id
Type boolean
Description

Flag to indicate wheter the organization is seeking other needs through the app.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default false
Sample false
Comments
2.1.2.7.3.36 Field global
2.1.2.7.3.36.1 global Tree Diagram
2.1.2.7.3.36.2 global properties
PropertyValue
Name global
Technical name
Id
Type boolean
Description

Flag to indicate wheter this organization is global.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default false
Sample
Comments
2.1.2.7.3.37 Field urls
2.1.2.7.3.37.1 urls Tree Diagram
2.1.2.7.3.37.2 urls Hierarchy
Parent field: [1] subschema
Child field(s):
FieldTypeReqKeyDescriptionComments
linkedinstringfalse

URL to organization's Linkedin page.

twitterstringfalse

URL to organization's Twitter page.

websitestringfalse

URL to organization's website.

playstorestringfalse

URL to organization's page at Google Play Store.

appstorestringfalse

URL to organization's page at Apple App Store

2.1.2.7.3.37.3 urls properties
PropertyValue
Name urls
Technical name
Id
Type document
Description

Document holding external urls and refs to the organization such as social media profiles.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
DBRef
Min Properties
Max Properties
Additional properties false
Comments
2.1.2.7.3.38 Field linkedin
2.1.2.7.3.38.1 linkedin Tree Diagram
2.1.2.7.3.38.2 linkedin properties
PropertyValue
Name linkedin
Technical name
Id
Type string
Description

URL to organization's Linkedin page.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format uri
Enum
Sample http://linkedin.com/in/myProfile
Comments
2.1.2.7.3.39 Field twitter
2.1.2.7.3.39.1 twitter Tree Diagram
2.1.2.7.3.39.2 twitter properties
PropertyValue
Name twitter
Technical name
Id
Type string
Description

URL to organization's Twitter page.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format uri
Enum
Sample http://twitter.com/myProfile
Comments
2.1.2.7.3.40 Field website
2.1.2.7.3.40.1 website Tree Diagram
2.1.2.7.3.40.2 website properties
PropertyValue
Name website
Technical name
Id
Type string
Description

URL to organization's website.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format uri
Enum
Sample http://mypersonalwebsite.com
Comments
2.1.2.7.3.41 Field playstore
2.1.2.7.3.41.1 playstore Tree Diagram
2.1.2.7.3.41.2 playstore properties
PropertyValue
Name playstore
Technical name
Id
Type string
Description

URL to organization's page at Google Play Store.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format uri
Enum
Sample http://playstore.com/myOrg
Comments
2.1.2.7.3.42 Field appstore
2.1.2.7.3.42.1 appstore Tree Diagram
2.1.2.7.3.42.2 appstore properties
PropertyValue
Name appstore
Technical name
Id
Type string
Description

URL to organization's page at Apple App Store

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format uri
Enum
Sample http://appstore.com/myOrg
Comments
2.1.2.7.3.43 Field language
2.1.2.7.3.43.1 language Tree Diagram
2.1.2.7.3.43.2 language properties
PropertyValue
Name language
Technical name
Id
Type string
Description

Field to inidicate the language used by the organization.

Dependencies
Required false
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.7.3.44 Field anyOf
2.1.2.7.3.44.1 anyOf Tree Diagram
2.1.2.7.3.44.2 anyOf Hierarchy
Parent field: users
Child field(s):
FieldTypeReqKeyDescriptionComments
subschemasubschemafalse

Case where the user comes from social networks with a registration that uses email. In this case, the email field is required. This case covers the great majority of currently supported social network authentications.

subschemasubschemafalse

Case where the user comes from social networks with a registration that allows the use of only the phone. In this case, the phone field is required, and the email isn't.

An example of ocial network that falls into this case is Twitter.

2.1.2.7.3.44.3 anyOf properties
PropertyValue
Choice anyOf
Description
Comments
2.1.2.7.3.45 Field [0] subschema
2.1.2.7.3.45.1 [0] subschema Tree Diagram
2.1.2.7.3.45.2 [0] subschema Hierarchy
Parent field: anyOf
Child field(s):
FieldTypeReqKeyDescriptionComments
emailstringtrue

User's email validated by a regex pattern.

2.1.2.7.3.45.3 [0] subschema properties
PropertyValue
Display name subschema
Id emailPK
Description

Case where the user comes from social networks with a registration that uses email. In this case, the email field is required. This case covers the great majority of currently supported social network authentications.

Required
Min Properties
Max Properties
Additional properties true
Comments
2.1.2.7.3.46 Field email
2.1.2.7.3.46.1 email Tree Diagram
2.1.2.7.3.46.2 email properties
PropertyValue
Name email
Technical name
Id
Type string
Description

User's email validated by a regex pattern.

Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format email
Enum
Sample test_user@fightpandemics.com
Comments
2.1.2.7.3.47 Field [1] subschema
2.1.2.7.3.47.1 [1] subschema Tree Diagram
2.1.2.7.3.47.2 [1] subschema Hierarchy
Parent field: anyOf
Child field(s):
FieldTypeReqKeyDescriptionComments
phonestringtrue
2.1.2.7.3.47.3 [1] subschema properties
PropertyValue
Display name subschema
Id phonePK
Description

Case where the user comes from social networks with a registration that allows the use of only the phone. In this case, the phone field is required, and the email isn't.

An example of ocial network that falls into this case is Twitter.

Required
Min Properties
Max Properties
Additional properties false
Comments
2.1.2.7.3.48 Field phone
2.1.2.7.3.48.1 phone Tree Diagram
2.1.2.7.3.48.2 phone properties
PropertyValue
Name phone
Technical name
Id
Type string
Description
Dependencies
Required true
Primary key false
Foreign collection
Foreign field
Relationship type
Default
Min length
Max length
Pattern
Format
Enum
Sample
Comments
2.1.2.7.4 users JSON Schema
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "title": "users",
    "description": "Collection that holds all the data on system's users. \n\nThe users can be of **two types**: **(1) Individual**, representing a private user account; and **(2) Organization**, representing an organization of various types.\n\nThe field 'type' is used to differentiate between the two subschemas, with 'individual' representing private user accounts and \"Community\", \"Government\", \"Health care provider\", \"Non-profit\", \"Other\", \"R&D\", \"Startup\", \"Traditional Company\" and \"University\".",
    "additionalProperties": true,
    "properties": {
        "createdAt": {
            "type": "string",
            "description": "Timestamp with the user's creation date",
            "format": "date-time"
        },
        "_id": {
            "type": "string",
            "description": "Automatically generated _it as primary key.",
            "pattern": "^[a-fA-F0-9]{24}$"
        },
        "updatedAt": {
            "type": "string",
            "description": "Timestamp indicating last update on the database.",
            "format": "date-time"
        },
        "authId": {
            "type": "string",
            "description": "String holding the authentication service id (Auth0).\n\nThis field is a **foreign key to the user in the Auth0 database**, connecting through the user_id field."
        },
        "location": {
            "$ref": "#model/definitions/location"
        },
        "about": {
            "type": "string",
            "description": "Small self-introduction, limited to 100 char"
        },
        "photo": {
            "type": "string",
            "description": "URI with the location of the profile's photo.",
            "format": "uri"
        }
    },
    "oneOf": [
        {
            "id": "individual",
            "type": "object",
            "description": "Subschema representing a individual account.",
            "properties": {
                "type": {
                    "type": "string",
                    "enum": [
                        "individual"
                    ]
                },
                "firstName": {
                    "type": "string",
                    "description": "The first name of the user"
                },
                "lastName": {
                    "type": "string",
                    "description": "The last name of the user. Optional field."
                },
                "needs": {
                    "type": "object",
                    "description": "User's need in the app, representing what kind of help he/she needs",
                    "properties": {
                        "medicalHelp": {
                            "type": "boolean",
                            "description": "Flag to indicate wheter the user needs medical help. \nMarking this indicates he shows symptoms of COVID-19.",
                            "default": false
                        },
                        "otherHelp": {
                            "type": "boolean",
                            "description": "Flag to indicate wheter the user needs non-medical help, such as getting groceries, medice and etc..",
                            "default": false
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "medicalHelp",
                        "otherHelp"
                    ]
                },
                "objectives": {
                    "type": "object",
                    "description": "Document with what are the objectives of the user through the application, such as donating, volunteering or sharing information.",
                    "properties": {
                        "volunteer": {
                            "type": "boolean",
                            "description": "Flag to indicate wheter the user wants to volunteer for iniciatives through the app.",
                            "default": false
                        },
                        "donate": {
                            "type": "boolean",
                            "description": "Flag to indicate wheter the user wants to donate for iniciatives through the app.",
                            "default": false
                        },
                        "shareInformation": {
                            "type": "boolean",
                            "description": "Flag to indicate wheter the user wants to share information through the app.",
                            "default": true
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "volunteer",
                        "donate",
                        "shareInformation"
                    ]
                },
                "urls": {
                    "type": "object",
                    "description": "Document holding the user urls to external websites and social networks",
                    "properties": {
                        "facebook": {
                            "type": "string",
                            "description": "URL to user's Facebook page.",
                            "format": "uri"
                        },
                        "linkedin": {
                            "type": "string",
                            "description": "URL to user's Linkedin page.",
                            "format": "uri"
                        },
                        "twitter": {
                            "type": "string",
                            "description": "URL to user's Twitter page.",
                            "format": "uri"
                        },
                        "github": {
                            "type": "string",
                            "description": "URL to user's Github page.",
                            "format": "uri"
                        },
                        "website": {
                            "type": "string",
                            "description": "URL to user's personal website.",
                            "format": "uri"
                        }
                    },
                    "additionalProperties": false
                }
            },
            "additionalProperties": true,
            "required": [
                "type",
                "firstName",
                "needs"
            ]
        },
        {
            "id": "organization",
            "type": "object",
            "description": "Subschema representing an organization (colective) account.",
            "properties": {
                "type": {
                    "type": "string",
                    "description": "The type of the organization. Can be: Community, Government, Health care provider, Non-profit, Other, R&D, Startup, Traditional Company and University. All names are store in lowercase only.",
                    "enum": [
                        "startup",
                        "traditional company",
                        "community",
                        "government",
                        "r&d",
                        "non-profit",
                        "university",
                        "health care provider",
                        "other"
                    ]
                },
                "industry": {
                    "type": "string",
                    "description": "Industry from which the organization participates. Plan is for this values to be scraped from linkedin industries."
                },
                "ownerId": {
                    "type": "string",
                    "description": "_id of the user who owns the organization.",
                    "pattern": "^[a-fA-F0-9]{24}$"
                },
                "name": {
                    "type": "string",
                    "description": "Organization's name.\n"
                },
                "needs": {
                    "type": "object",
                    "description": "Document with what are the objectives of the organization through the application, such as finding volunteers, staff, investors and donors.",
                    "properties": {
                        "volunteers": {
                            "type": "boolean",
                            "description": "Flag to indicate wheter the organization is seeking volunteers through the app.",
                            "default": false
                        },
                        "donations": {
                            "type": "boolean",
                            "description": "Flag to indicate wheter the organization is seeking donations through the app.",
                            "default": false
                        },
                        "staff": {
                            "type": "boolean",
                            "description": "Flag to indicate wheter the organization is seeking staff through the app.",
                            "default": false
                        },
                        "other": {
                            "type": "boolean",
                            "description": "Flag to indicate wheter the organization is seeking other needs through the app.",
                            "default": false
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "volunteers",
                        "donations",
                        "staff",
                        "other"
                    ]
                },
                "global": {
                    "type": "boolean",
                    "description": "Flag to indicate wheter this organization is global.",
                    "default": false
                },
                "urls": {
                    "type": "object",
                    "description": "Document holding external urls and refs to the organization such as social media profiles.",
                    "properties": {
                        "linkedin": {
                            "type": "string",
                            "description": "URL to organization's Linkedin page.",
                            "format": "uri"
                        },
                        "twitter": {
                            "type": "string",
                            "description": "URL to organization's Twitter page.",
                            "format": "uri"
                        },
                        "website": {
                            "type": "string",
                            "description": "URL to organization's website.",
                            "format": "uri"
                        },
                        "playstore": {
                            "type": "string",
                            "description": "URL to organization's page at Google Play Store.",
                            "format": "uri"
                        },
                        "appstore": {
                            "type": "string",
                            "description": "URL to organization's page at Apple App Store",
                            "format": "uri"
                        }
                    },
                    "additionalProperties": false
                },
                "language": {
                    "type": "string",
                    "description": "Field to inidicate the language used by the organization."
                }
            },
            "additionalProperties": false,
            "required": [
                "type",
                "industry",
                "ownerId",
                "name",
                "needs"
            ]
        }
    ],
    "anyOf": [
        {
            "id": "emailPK",
            "type": "object",
            "description": "Case where the user comes from social networks with a registration that uses email. In this case, the email field is required. This case covers the great majority of currently supported social network authentications.",
            "properties": {
                "email": {
                    "type": "string",
                    "description": "User's email validated by a regex pattern.",
                    "format": "email"
                }
            },
            "additionalProperties": true,
            "required": [
                "email"
            ]
        },
        {
            "id": "phonePK",
            "type": "object",
            "description": "Case where the user comes from social networks with a registration that allows the use of only the phone. In this case, the phone field is required, and the email isn't. \n\nAn example of ocial network that falls into this case is Twitter.",
            "properties": {
                "phone": {
                    "type": "string"
                }
            },
            "additionalProperties": false,
            "required": [
                "phone"
            ]
        }
    ],
    "required": [
        "createdAt",
        "_id",
        "updatedAt",
        "authId"
    ]
}
2.1.2.7.5 users JSON data
{
    "createdAt": ISODate("2016-04-08T15:06:21.595Z"),
    "_id": ObjectId("507f1f77bcf86cd799439011"),
    "updatedAt": ISODate("2016-04-08T15:06:21.595Z"),
    "authId": "Lorem",
    "location": {
        "coordinates": [
            35.26,
            -32.83
        ],
        "type": "Point",
        "country": "Lorem",
        "city": "Lorem",
        "neighborhood": "Lorem",
        "address": "Lorem"
    },
    "about": "Lorem",
    "photo": "./resource.txt#frag01",
    "type": "other",
    "industry": "Lorem",
    "ownerId": ObjectId("507f1f77bcf86cd799439011"),
    "name": "Lorem",
    "needs": {
        "volunteers": true,
        "donations": false,
        "staff": false,
        "other": false
    },
    "global": false,
    "urls": {
        "linkedin": "http://linkedin.com/in/myProfile",
        "twitter": "http://twitter.com/myProfile",
        "website": "http://mypersonalwebsite.com",
        "playstore": "http://playstore.com/myOrg",
        "appstore": "http://appstore.com/myOrg"
    },
    "language": "Lorem",
    "email": "test_user@fightpandemics.com"
}
2.1.2.7.6 users Target Script
use applicationDB;

db.createCollection( "users",{
    "storageEngine": {
        "wiredTiger": {}
    },
    "capped": false,
    "validator": {
        "$jsonSchema": {
            "bsonType": "object",
            "title": "users",
            "description": "Collection that holds all the data on system's users. \n\nThe users can be of **two types**: **(1) Individual**, representing a private user account; and **(2) Organization**, representing an organization of various types.\n\nThe field 'type' is used to differentiate between the two subschemas, with 'individual' representing private user accounts and \"Community\", \"Government\", \"Health care provider\", \"Non-profit\", \"Other\", \"R&D\", \"Startup\", \"Traditional Company\" and \"University\".",
            "additionalProperties": true,
            "properties": {
                "_id": {
                    "bsonType": "objectId",
                    "description": "Automatically generated _it as primary key."
                },
                "createdAt": {
                    "bsonType": "date",
                    "description": "Timestamp with the user's creation date"
                },
                "updatedAt": {
                    "bsonType": "date",
                    "description": "Timestamp indicating last update on the database."
                },
                "authId": {
                    "bsonType": "string",
                    "description": "String holding the authentication service id (Auth0).\n\nThis field is a **foreign key to the user in the Auth0 database**, connecting through the user_id field."
                },
                "location": {
                    "bsonType": "object",
                    "description": "Location document according to the norms of a [GeoJSON Object](https://docs.mongodb.com/manual/reference/geojson/ ).\nThe fields address, neighborhood, city, state and country are added to store the result of the geoprocessing.",
                    "properties": {
                        "coordinates": {
                            "bsonType": "array",
                            "description": "Array with the coordinates, specifying **longitude first** and **latitude second**, as default in the [GeoJSON](https://docs.mongodb.com/manual/reference/geojson/) definition.",
                            "additionalItems": true,
                            "minItems": 2,
                            "maxItems": 2,
                            "uniqueItems": false,
                            "items": [
                                {
                                    "bsonType": "number",
                                    "description": "Location longitude\n",
                                    "minimum": -180,
                                    "maximum": 180
                                },
                                {
                                    "bsonType": "number",
                                    "description": "Location latitude\n",
                                    "minimum": -90,
                                    "maximum": 90
                                }
                            ]
                        },
                        "type": {
                            "bsonType": "string",
                            "description": "Type of the GeoJSON Object.\nPlease refer to the [official documentation](https://docs.mongodb.com/manual/reference/geojson/ ) for more information.\n\n**In our case, the value will always be of the type \"Point\".**",
                            "enum": [
                                "Point"
                            ]
                        },
                        "country": {
                            "bsonType": "string",
                            "description": "String holding the country's name.\n"
                        },
                        "city": {
                            "bsonType": "string",
                            "description": "String holding the city's name."
                        },
                        "neighborhood": {
                            "bsonType": "string",
                            "description": "String holding the neighborhood's name."
                        },
                        "address": {
                            "bsonType": "string",
                            "description": "String holding the address (street, number and other details)."
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "coordinates",
                        "type"
                    ]
                },
                "about": {
                    "bsonType": "string",
                    "description": "Small self-introduction, limited to 100 char"
                },
                "photo": {
                    "bsonType": "string",
                    "description": "URI with the location of the profile's photo."
                }
            },
            "oneOf": [
                {
                    "bsonType": "object",
                    "description": "Subschema representing a individual account.",
                    "properties": {
                        "type": {
                            "bsonType": "string",
                            "enum": [
                                "individual"
                            ]
                        },
                        "firstName": {
                            "bsonType": "string",
                            "description": "The first name of the user"
                        },
                        "lastName": {
                            "bsonType": "string",
                            "description": "The last name of the user. Optional field."
                        },
                        "needs": {
                            "bsonType": "object",
                            "description": "User's need in the app, representing what kind of help he/she needs",
                            "properties": {
                                "medicalHelp": {
                                    "bsonType": "bool",
                                    "description": "Flag to indicate wheter the user needs medical help. \nMarking this indicates he shows symptoms of COVID-19."
                                },
                                "otherHelp": {
                                    "bsonType": "bool",
                                    "description": "Flag to indicate wheter the user needs non-medical help, such as getting groceries, medice and etc.."
                                }
                            },
                            "additionalProperties": false,
                            "required": [
                                "medicalHelp",
                                "otherHelp"
                            ]
                        },
                        "objectives": {
                            "bsonType": "object",
                            "description": "Document with what are the objectives of the user through the application, such as donating, volunteering or sharing information.",
                            "properties": {
                                "volunteer": {
                                    "bsonType": "bool",
                                    "description": "Flag to indicate wheter the user wants to volunteer for iniciatives through the app."
                                },
                                "donate": {
                                    "bsonType": "bool",
                                    "description": "Flag to indicate wheter the user wants to donate for iniciatives through the app."
                                },
                                "shareInformation": {
                                    "bsonType": "bool",
                                    "description": "Flag to indicate wheter the user wants to share information through the app."
                                }
                            },
                            "additionalProperties": false,
                            "required": [
                                "volunteer",
                                "donate",
                                "shareInformation"
                            ]
                        },
                        "urls": {
                            "bsonType": "object",
                            "description": "Document holding the user urls to external websites and social networks",
                            "properties": {
                                "facebook": {
                                    "bsonType": "string",
                                    "description": "URL to user's Facebook page."
                                },
                                "linkedin": {
                                    "bsonType": "string",
                                    "description": "URL to user's Linkedin page."
                                },
                                "twitter": {
                                    "bsonType": "string",
                                    "description": "URL to user's Twitter page."
                                },
                                "github": {
                                    "bsonType": "string",
                                    "description": "URL to user's Github page."
                                },
                                "website": {
                                    "bsonType": "string",
                                    "description": "URL to user's personal website."
                                }
                            },
                            "additionalProperties": false
                        }
                    },
                    "additionalProperties": true,
                    "required": [
                        "type",
                        "firstName",
                        "needs"
                    ]
                },
                {
                    "bsonType": "object",
                    "description": "Subschema representing an organization (colective) account.",
                    "properties": {
                        "type": {
                            "bsonType": "string",
                            "description": "The type of the organization. Can be: Community, Government, Health care provider, Non-profit, Other, R&D, Startup, Traditional Company and University. All names are store in lowercase only.",
                            "enum": [
                                "startup",
                                "traditional company",
                                "community",
                                "government",
                                "r&d",
                                "non-profit",
                                "university",
                                "health care provider",
                                "other"
                            ]
                        },
                        "industry": {
                            "bsonType": "string",
                            "description": "Industry from which the organization participates. Plan is for this values to be scraped from linkedin industries."
                        },
                        "ownerId": {
                            "bsonType": "objectId",
                            "description": "_id of the user who owns the organization."
                        },
                        "name": {
                            "bsonType": "string",
                            "description": "Organization's name.\n"
                        },
                        "needs": {
                            "bsonType": "object",
                            "description": "Document with what are the objectives of the organization through the application, such as finding volunteers, staff, investors and donors.",
                            "properties": {
                                "volunteers": {
                                    "bsonType": "bool",
                                    "description": "Flag to indicate wheter the organization is seeking volunteers through the app."
                                },
                                "donations": {
                                    "bsonType": "bool",
                                    "description": "Flag to indicate wheter the organization is seeking donations through the app."
                                },
                                "staff": {
                                    "bsonType": "bool",
                                    "description": "Flag to indicate wheter the organization is seeking staff through the app."
                                },
                                "other": {
                                    "bsonType": "bool",
                                    "description": "Flag to indicate wheter the organization is seeking other needs through the app."
                                }
                            },
                            "additionalProperties": false,
                            "required": [
                                "volunteers",
                                "donations",
                                "staff",
                                "other"
                            ]
                        },
                        "global": {
                            "bsonType": "bool",
                            "description": "Flag to indicate wheter this organization is global."
                        },
                        "urls": {
                            "bsonType": "object",
                            "description": "Document holding external urls and refs to the organization such as social media profiles.",
                            "properties": {
                                "linkedin": {
                                    "bsonType": "string",
                                    "description": "URL to organization's Linkedin page."
                                },
                                "twitter": {
                                    "bsonType": "string",
                                    "description": "URL to organization's Twitter page."
                                },
                                "website": {
                                    "bsonType": "string",
                                    "description": "URL to organization's website."
                                },
                                "playstore": {
                                    "bsonType": "string",
                                    "description": "URL to organization's page at Google Play Store."
                                },
                                "appstore": {
                                    "bsonType": "string",
                                    "description": "URL to organization's page at Apple App Store"
                                }
                            },
                            "additionalProperties": false
                        },
                        "language": {
                            "bsonType": "string",
                            "description": "Field to inidicate the language used by the organization."
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "type",
                        "industry",
                        "ownerId",
                        "name",
                        "needs"
                    ]
                }
            ],
            "anyOf": [
                {
                    "bsonType": "object",
                    "description": "Case where the user comes from social networks with a registration that uses email. In this case, the email field is required. This case covers the great majority of currently supported social network authentications.",
                    "properties": {
                        "email": {
                            "bsonType": "string",
                            "description": "User's email validated by a regex pattern."
                        }
                    },
                    "additionalProperties": true,
                    "required": [
                        "email"
                    ]
                },
                {
                    "bsonType": "object",
                    "description": "Case where the user comes from social networks with a registration that allows the use of only the phone. In this case, the phone field is required, and the email isn't. \n\nAn example of ocial network that falls into this case is Twitter.",
                    "properties": {
                        "phone": {
                            "bsonType": "string"
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "phone"
                    ]
                }
            ],
            "required": [
                "createdAt",
                "_id",
                "updatedAt",
                "authId"
            ]
        }
    },
    "validationLevel": "off",
    "validationAction": "warn"
});
3. Relationships
3.1 Relationship CommentReferencesPost
3.1.1 CommentReferencesPost Diagram
Parent TableParent field
comments _id
Child TableChild field
comments parentId
3.1.2 CommentReferencesPost Properties
PropertyValue
Name CommentReferencesPost
Description
Parent Collectioncomments
Parent field_id
Parent Cardinality 1
Child Collectioncomments
Child fieldparentId
Child Cardinality 1
Comments
3.2 Relationship MessageNotification
3.2.1 MessageNotification Diagram
Parent TableParent field
thread _id
Child TableChild field
notifications [-1].(2).threadId
3.2.2 MessageNotification Properties
PropertyValue
Name MessageNotification
Description
Parent Collectionthread
Parent field_id
Parent Cardinality 1
Child Collectionnotifications
Child fieldthreadId
Child Cardinality 1
Comments
3.3 Relationship Notification Receiver
3.3.1 Notification Receiver Diagram
Parent TableParent field
users _id
Child TableChild field
notifications receiver.id
3.3.2 Notification Receiver Properties
PropertyValue
Name Notification Receiver
Description
Parent Collectionusers
Parent field_id
Parent Cardinality 1
Child Collectionnotifications
Child fieldid
Child Cardinality 1
Comments
3.4 Relationship OrganizationNotification
3.4.1 OrganizationNotification Diagram
Parent TableParent field
users _id
Child TableChild field
notifications [-1].[-1].organizationId
3.4.2 OrganizationNotification Properties
PropertyValue
Name OrganizationNotification
Description
Parent Collectionusers
Parent field_id
Parent Cardinality 1
Child Collectionnotifications
Child fieldorganizationId
Child Cardinality 1
Comments
3.5 Relationship PostHasComments
3.5.1 PostHasComments Diagram
Parent TableParent field
posts _id
Child TableChild field
comments postId
3.5.2 PostHasComments Properties
PropertyValue
Name PostHasComments
Description Relationship between a Post and it's respective Comments made at it.
Parent Collectionposts
Parent field_id
Parent Cardinality 1
Child Collectioncomments
Child fieldpostId
Child Cardinality n
Comments
3.6 Relationship PostNotification
3.6.1 PostNotification Diagram
Parent TableParent field
posts _id
Child TableChild field
notifications [-1].[-1].postId
3.6.2 PostNotification Properties
PropertyValue
Name PostNotification
Description
Parent Collectionposts
Parent field_id
Parent Cardinality 1
Child Collectionnotifications
Child fieldpostId
Child Cardinality 1
Comments
3.7 Relationship ThreadHasMessages
3.7.1 ThreadHasMessages Diagram
Parent TableParent field
thread _id
Child TableChild field
messages threadId
3.7.2 ThreadHasMessages Properties
PropertyValue
Name ThreadHasMessages
Description
Parent Collectionthread
Parent field_id
Parent Cardinality 1
Child Collectionmessages
Child fieldthreadId
Child Cardinality 1
Comments
3.8 Relationship UserAuthorsComment
3.8.1 UserAuthorsComment Diagram
Parent TableParent field
users _id
Child TableChild field
comments author.[-1].id
3.8.2 UserAuthorsComment Properties
PropertyValue
Name UserAuthorsComment
Description
Parent Collectionusers
Parent field_id
Parent Cardinality 1
Child Collectioncomments
Child fieldid
Child Cardinality 1
Comments
3.9 Relationship UserAuthorsPost
3.9.1 UserAuthorsPost Diagram
Parent TableParent field
users _id
Child TableChild field
posts author.[-1].id
3.9.2 UserAuthorsPost Properties
PropertyValue
Name UserAuthorsPost
Description Relation between a User and the Post created by him/her.
Parent Collectionusers
Parent field_id
Parent Cardinality 1
Child Collectionposts
Child fieldid
Child Cardinality n
Comments
3.10 Relationship UserGivesFeedback
3.10.1 UserGivesFeedback Diagram
Parent TableParent field
users _id
Child TableChild field
feedbacks userId
3.10.2 UserGivesFeedback Properties
PropertyValue
Name UserGivesFeedback
Description
Parent Collectionusers
Parent field_id
Parent Cardinality 1
Child Collectionfeedbacks
Child fielduserId
Child Cardinality 1
Comments
3.11 Relationship UserLikesComment
3.11.1 UserLikesComment Diagram
Parent TableParent field
users _id
Child TableChild field
comments likes.[-1]
3.11.2 UserLikesComment Properties
PropertyValue
Name UserLikesComment
Description Relation to represent the User's who liked a Comment. Even though this is a N-N relation, we opt to store the ids only at the Comment side as an array of _id (with the _id of the users who liked it).
Parent Collectionusers
Parent field_id
Parent Cardinality n
Child Collectioncomments
Child field
Child Cardinality n
Comments
3.12 Relationship UserLikesPost
3.12.1 UserLikesPost Diagram
Parent TableParent field
users _id
Child TableChild field
posts likes.[-1]
3.12.2 UserLikesPost Properties
PropertyValue
Name UserLikesPost
Description Relation to represent the User's who liked a Post. Even though this is a N-N relation, we opt to store the ids only at the Post side as an array of _id (with the _id of the users who liked it).
Parent Collectionusers
Parent field_id
Parent Cardinality n
Child Collectionposts
Child field
Child Cardinality n
Comments
3.13 Relationship UserOwnsOrganization
3.13.1 UserOwnsOrganization Diagram
Parent TableParent field
users _id
Child TableChild field
users [-1].[-1].ownerId
3.13.2 UserOwnsOrganization Properties
PropertyValue
Name UserOwnsOrganization
Description Relation between an User and an Organization created by him/her. Initially projected as 1-N, with only one User owning the Organization, it is though to later on be evolved into N-N, with many Users being able to manage the Organization with different roles.
Parent Collectionusers
Parent field_id
Parent Cardinality 1
Child Collectionusers
Child fieldownerId
Child Cardinality n
Comments
3.14 Relationship UserSentMessage
3.14.1 UserSentMessage Diagram
Parent TableParent field
users _id
Child TableChild field
messages authorId
3.14.2 UserSentMessage Properties
PropertyValue
Name UserSentMessage
Description
Parent Collectionusers
Parent field_id
Parent Cardinality 1
Child Collectionmessages
Child fieldauthorId
Child Cardinality 1
Comments